From 73e51133c3a143b8838e7f7fed599a33aca1b1f1 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 17 Mar 2022 17:22:57 -0700 Subject: [PATCH] langref: small clarification of `@reduce` --- doc/langref.html.in | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index 895a3c56ea..a6241f541b 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -9352,22 +9352,23 @@ test "vector @splat" { {#header_close#} {#header_open|@reduce#} -
{#syntax#}@reduce(comptime op: std.builtin.ReduceOp, value: anytype) std.meta.Child(value){#endsyntax#}
+
{#syntax#}@reduce(comptime op: std.builtin.ReduceOp, value: anytype) E{#endsyntax#}

- Transforms a {#link|vector|Vectors#} into a scalar value by performing a - sequential horizontal reduction of its elements using the specified operator {#syntax#}op{#endsyntax#}. + Transforms a {#link|vector|Vectors#} into a scalar value (of type E) + by performing a sequential horizontal reduction of its elements using the + specified operator {#syntax#}op{#endsyntax#}.

Not every operator is available for every vector element type:

Note that {#syntax#}.Add{#endsyntax#} and {#syntax#}.Mul{#endsyntax#}