| ... | ... | @@ -9352,22 +9352,23 @@ test "vector @splat" { |
| 9352 | 9352 | {#header_close#} |
| 9353 | 9353 | |
| 9354 | 9354 | {#header_open|@reduce#} |
| 9355 | | <pre>{#syntax#}@reduce(comptime op: std.builtin.ReduceOp, value: anytype) std.meta.Child(value){#endsyntax#}</pre> |
| 9355 | <pre>{#syntax#}@reduce(comptime op: std.builtin.ReduceOp, value: anytype) E{#endsyntax#}</pre> |
| 9356 | 9356 | <p> |
| 9357 | | Transforms a {#link|vector|Vectors#} into a scalar value by performing a |
| 9358 | | sequential horizontal reduction of its elements using the specified operator {#syntax#}op{#endsyntax#}. |
| 9357 | Transforms a {#link|vector|Vectors#} into a scalar value (of type <code>E</code>) |
| 9358 | by performing a sequential horizontal reduction of its elements using the |
| 9359 | specified operator {#syntax#}op{#endsyntax#}. |
| 9359 | 9360 | </p> |
| 9360 | 9361 | <p> |
| 9361 | 9362 | Not every operator is available for every vector element type: |
| 9362 | 9363 | </p> |
| 9363 | 9364 | <ul> |
| 9365 | <li>Every operator is available for {#link|integer|Integers#} vectors.</li> |
| 9364 | 9366 | <li>{#syntax#}.And{#endsyntax#}, {#syntax#}.Or{#endsyntax#}, |
| 9365 | | {#syntax#}.Xor{#endsyntax#} are available for |
| 9367 | {#syntax#}.Xor{#endsyntax#} are additionally available for |
| 9366 | 9368 | {#syntax#}bool{#endsyntax#} vectors,</li> |
| 9367 | 9369 | <li>{#syntax#}.Min{#endsyntax#}, {#syntax#}.Max{#endsyntax#}, |
| 9368 | 9370 | {#syntax#}.Add{#endsyntax#}, {#syntax#}.Mul{#endsyntax#} are |
| 9369 | | available for {#link|floating point|Floats#} vectors,</li> |
| 9370 | | <li>Every operator is available for {#link|integer|Integers#} vectors.</li> |
| 9371 | additionally available for {#link|floating point|Floats#} vectors,</li> |
| 9371 | 9372 | </ul> |
| 9372 | 9373 | <p> |
| 9373 | 9374 | Note that {#syntax#}.Add{#endsyntax#} and {#syntax#}.Mul{#endsyntax#} |