Built-in Functions

Built-in Functions
abs() min() max()
len() round() ceil()
floor() sqrt() ldexp()

abs(x)

Return the absolute value of a number. The argument may be an scalar or a vector.

res = abs(int32x4(-3, 4, -7, 1))  # res = 3, 4, 7, 1

min(x, y)

Returns the smallest of x and y.

res = min(int32x2(2, 4), int32x2(3, 1))  # res = 2, 1

max(x, y)

Returns the largest of x and y.

res = max(int32x2(2, 4), int32x2(3, 1))  # res = 3, 4

len(array)

Return the length of an array.

arr_length = len(array)  # arr_length is of int64 type

round(x)

The value of x rounded to the nearest integer (as a float value).

res = round(float64x2(0.7, 2.8))  # res = 1.0, 3.0

ceil(x)

Rounds x upward, returning the smallest integral value that is not less than x (as a float value).

res = ceil(float64x2(0.3, 2.8))  # res = 1.0, 3.0

floor(x)

Rounds x downward, returning the largest integral value that is not greater than x (as a float value).

res = floor(float64x2(0.3, 2.8))  # res = 0.0, 2.0

sqrt(x)

Return the square root of x.

res = sqrt(float64x2(0.3, 2.8))

ldexp(x, i)

Return x * (2**i).

res = ldexp(float64x2(0.3, 2.8), int32x2(2, 4))