SIMD module

operator/

procedure · 3 overloadsSource

Divides the lanes of a by those of b.

Integer lanes round toward zero. Division by zero behaves as scalar division does: it is not checked, and an integer lane traps or gives a platform result, while a float lane gives infinity or NaN.

ExampleOpen in playground ↗
a := set(4, cast(s32) 15);
assert((a / set(4, cast(s32) 5)).data[0] == 3);
assert((a / cast(s32) 2).data[0] == 7);
assert((cast(s32) 30 / a).data[0] == 2);
operator/ :: (a: $T/SIMD_Array, b: T) -> T

Divides the lanes of a by those of b.

Integer lanes round toward zero. Division by zero behaves as scalar division does: it is not checked, and an integer lane traps or gives a platform result, while a float lane gives infinity or NaN.

Parameters

b: T

Returns

T
ExampleOpen in playground ↗
a := set(4, cast(s32) 15);
assert((a / set(4, cast(s32) 5)).data[0] == 3);
assert((a / cast(s32) 2).data[0] == 7);
assert((cast(s32) 30 / a).data[0] == 2);
operator/ :: (a: $T/SIMD_Array, factor: a.type) -> T

Divides every lane by factor. The scalar can be on either side: scalar / vector divides the scalar by every lane.

Parameters

factor: a.type

Returns

T
operator/ :: (factor: $E, a: SIMD_Array($N, E)) -> SIMD_Array(N, E)

Applies / with the scalar factor on the left: each lane of the result is factor / the lane of a.

Parameters

factor: $E
a: SIMD_Array($N, E)

Returns

See also