Skip to content
View source

Math builtinsGenerated

The builtins of kind math, as the compiler’s own table lists them.

Returns Function Requires
Float abs (x: Float) +14 —
Float acos (x: Float) +7 —
Int add_wrap (a: Int, b: Int) +1 —
Float asin (x: Float) +7 —
Float atan (x: Float) +7 —
Float atan2 (y: Float, x: Float) +1 —
Int bits (x: Float) —
Float ceil (x: Float) +7 —
Float clamp (x: Float, low: Float, high: Float) +25 —
Int clz (x: Int) —
Float cos (x: Float) +7 —
Float cosh (x: Float) +7 —
Vec3 cross (a: Vec3, b: Vec3) +1 —
Int ctz (x: Int) —
Float degrees (x: Float) +3 —
Float determinant (m: Mat2) +3 —
Float distance (a: Vec2, b: Vec2) +2 —
Float dot (a: Vec2, b: Vec2) +3 —
Float exp (x: Float) +7 —
Float exp2 (x: Float) +7 —
Float floor (x: Float) +7 —
Float fma (a: Float, b: Float, c: Float) +7 —
Float fract (x: Float) +7 —
Float from_bits (x: Int) —
Mat2 inverse (m: Mat2) +3 —
Float inversesqrt (x: Float) +3 —
Bool isinf (x: Float) —
Bool isnan (x: Float) —
Float length (v: Vec2) +3 —
Float log (x: Float) +7 —
Float log2 (x: Float) +7 —
Float max (a: Float, b: Float) +25 —
Float min (a: Float, b: Float) +25 —
Float mix (a: Float, b: Float, t: Float) +13 —
Float mod (x: Float, y: Float) +6 —
Int mul_wrap (a: Int, b: Int) +1 —
Int mulhi (a: Int, b: Int) —
Vec2 normalize (v: Vec2) +3 —
Int popcount (x: Int) —
Float pow (base: Float, exponent: Float) +13 —
Float radians (x: Float) +3 —
Vec3 reflect (incident: Vec3, normal: Vec3) +2 —
Vec2 refract (incident: Vec2, normal: Vec2, eta: Float) +2 —
Int rotl (x: Int, n: Int) —
Int rotr (x: Int, n: Int) —
Float round (x: Float) +7 —
Float saturate (x: Float) +3 —
Float sign (x: Float) +14 —
Float sin (x: Float) +7 —
Float sinh (x: Float) +7 —
Float smoothstep (low: Float, high: Float, x: Float) +13 —
Float sqrt (x: Float) +7 —
Float step (edge: Float, x: Float) +13 —
Int sub_wrap (a: Int, b: Int) +1 —
Float tan (x: Float) +7 —
Float tanh (x: Float) +7 —
Mat2 transpose (m: Mat2) +3 —
Float trunc (x: Float) +7 —
Int udiv (a: Int, b: Int) —
Bool ult (a: Int, b: Int) —
Int umulhi (a: Int, b: Int) —
Int urem (a: Int, b: Int) —
abs(x: Float) -> Float
abs(x: Int) -> Int
abs(x: Vec2) -> Vec2
abs(x: Vec3) -> Vec3
abs(x: Vec4) -> Vec4
abs(x: IVec2) -> IVec2
abs(x: IVec3) -> IVec3
abs(x: IVec4) -> IVec4
abs(x: Double) -> Double
abs(x: Long) -> Long
abs(x: DVec2) -> DVec2
abs(x: DVec3) -> DVec3
abs(x: DVec4) -> DVec4
abs(x: LVec2) -> LVec2
abs(x: LVec3) -> LVec3

The absolute value, componentwise; an Int or IVec stays one.


acos(x: Float) -> Float
acos(x: Vec2) -> Vec2
acos(x: Vec3) -> Vec3
acos(x: Vec4) -> Vec4
acos(x: Double) -> Double
acos(x: DVec2) -> DVec2
acos(x: DVec3) -> DVec3
acos(x: DVec4) -> DVec4

The arc cosine, componentwise.


add_wrap(a: Int, b: Int) -> Int
add_wrap(a: Long, b: Long) -> Long

a + b modulo 2^32 on Ints: never a failure, unlike +.


asin(x: Float) -> Float
asin(x: Vec2) -> Vec2
asin(x: Vec3) -> Vec3
asin(x: Vec4) -> Vec4
asin(x: Double) -> Double
asin(x: DVec2) -> DVec2
asin(x: DVec3) -> DVec3
asin(x: DVec4) -> DVec4

The arc sine, componentwise.


atan(x: Float) -> Float
atan(x: Vec2) -> Vec2
atan(x: Vec3) -> Vec3
atan(x: Vec4) -> Vec4
atan(x: Double) -> Double
atan(x: DVec2) -> DVec2
atan(x: DVec3) -> DVec3
atan(x: DVec4) -> DVec4

The arc tangent of one value, componentwise; atan2 takes two.


atan2(y: Float, x: Float) -> Float
atan2(y: Double, x: Double) -> Double

The angle of the point (x, y) from the x axis, in -pi..pi.


bits(x: Float) -> Int

x’s 32 bits as an Int, unchanged: for a Float of no sign, the Ints order as the Floats do.


ceil(x: Float) -> Float
ceil(x: Vec2) -> Vec2
ceil(x: Vec3) -> Vec3
ceil(x: Vec4) -> Vec4
ceil(x: Double) -> Double
ceil(x: DVec2) -> DVec2
ceil(x: DVec3) -> DVec3
ceil(x: DVec4) -> DVec4

The smallest integer not less than x, componentwise.


clamp(x: Float, low: Float, high: Float) -> Float
clamp(x: Int, low: Int, high: Int) -> Int
clamp(x: Vec2, low: Float, high: Float) -> Vec2
clamp(x: Vec2, low: Vec2, high: Vec2) -> Vec2
clamp(x: Vec3, low: Float, high: Float) -> Vec3
clamp(x: Vec3, low: Vec3, high: Vec3) -> Vec3
clamp(x: Vec4, low: Float, high: Float) -> Vec4
clamp(x: Vec4, low: Vec4, high: Vec4) -> Vec4
clamp(x: IVec2, low: Int, high: Int) -> IVec2
clamp(x: IVec2, low: IVec2, high: IVec2) -> IVec2
clamp(x: IVec3, low: Int, high: Int) -> IVec3
clamp(x: IVec3, low: IVec3, high: IVec3) -> IVec3
clamp(x: IVec4, low: Int, high: Int) -> IVec4
clamp(x: IVec4, low: IVec4, high: IVec4) -> IVec4
clamp(x: Double, low: Double, high: Double) -> Double
clamp(x: Long, low: Long, high: Long) -> Long
clamp(x: DVec2, low: Double, high: Double) -> DVec2
clamp(x: DVec2, low: DVec2, high: DVec2) -> DVec2
clamp(x: DVec3, low: Double, high: Double) -> DVec3
clamp(x: DVec3, low: DVec3, high: DVec3) -> DVec3
clamp(x: DVec4, low: Double, high: Double) -> DVec4
clamp(x: DVec4, low: DVec4, high: DVec4) -> DVec4
clamp(x: LVec2, low: Long, high: Long) -> LVec2
clamp(x: LVec2, low: LVec2, high: LVec2) -> LVec2
clamp(x: LVec3, low: Long, high: Long) -> LVec3
clamp(x: LVec3, low: LVec3, high: LVec3) -> LVec3

x held between low and high, componentwise; Float bounds broadcast.


clz(x: Int) -> Int

How many zero bits lead x; 32 for zero.


cos(x: Float) -> Float
cos(x: Vec2) -> Vec2
cos(x: Vec3) -> Vec3
cos(x: Vec4) -> Vec4
cos(x: Double) -> Double
cos(x: DVec2) -> DVec2
cos(x: DVec3) -> DVec3
cos(x: DVec4) -> DVec4

The cosine, componentwise.


cosh(x: Float) -> Float
cosh(x: Vec2) -> Vec2
cosh(x: Vec3) -> Vec3
cosh(x: Vec4) -> Vec4
cosh(x: Double) -> Double
cosh(x: DVec2) -> DVec2
cosh(x: DVec3) -> DVec3
cosh(x: DVec4) -> DVec4

The hyperbolic cosine, componentwise.


cross(a: Vec3, b: Vec3) -> Vec3
cross(a: DVec3, b: DVec3) -> DVec3

The cross product of two three-component vectors.


ctz(x: Int) -> Int

How many zero bits trail x; 32 for zero.


degrees(x: Float) -> Float
degrees(x: Vec2) -> Vec2
degrees(x: Vec3) -> Vec3
degrees(x: Vec4) -> Vec4

Radians to degrees, componentwise.


determinant(m: Mat2) -> Float
determinant(m: Mat3) -> Float
determinant(m: Mat4) -> Float
determinant(m: DMat4) -> Double

The determinant of a square matrix, expanded along the first row.


distance(a: Vec2, b: Vec2) -> Float
distance(a: Vec3, b: Vec3) -> Float
distance(a: Vec4, b: Vec4) -> Float

The length of a - b.


dot(a: Vec2, b: Vec2) -> Float
dot(a: Vec3, b: Vec3) -> Float
dot(a: Vec4, b: Vec4) -> Float
dot(a: DVec3, b: DVec3) -> Double

The dot product of two vectors of one size: the componentwise product, summed first to last.


exp(x: Float) -> Float
exp(x: Vec2) -> Vec2
exp(x: Vec3) -> Vec3
exp(x: Vec4) -> Vec4
exp(x: Double) -> Double
exp(x: DVec2) -> DVec2
exp(x: DVec3) -> DVec3
exp(x: DVec4) -> DVec4

e raised to x, componentwise.


exp2(x: Float) -> Float
exp2(x: Vec2) -> Vec2
exp2(x: Vec3) -> Vec3
exp2(x: Vec4) -> Vec4
exp2(x: Double) -> Double
exp2(x: DVec2) -> DVec2
exp2(x: DVec3) -> DVec3
exp2(x: DVec4) -> DVec4

2 raised to x, componentwise.


floor(x: Float) -> Float
floor(x: Vec2) -> Vec2
floor(x: Vec3) -> Vec3
floor(x: Vec4) -> Vec4
floor(x: Double) -> Double
floor(x: DVec2) -> DVec2
floor(x: DVec3) -> DVec3
floor(x: DVec4) -> DVec4

The largest integer not greater than x, componentwise.


fma(a: Float, b: Float, c: Float) -> Float
fma(a: Vec2, b: Vec2, c: Vec2) -> Vec2
fma(a: Vec3, b: Vec3, c: Vec3) -> Vec3
fma(a: Vec4, b: Vec4, c: Vec4) -> Vec4
fma(a: Double, b: Double, c: Double) -> Double
fma(a: DVec2, b: DVec2, c: DVec2) -> DVec2
fma(a: DVec3, b: DVec3, c: DVec3) -> DVec3
fma(a: DVec4, b: DVec4, c: DVec4) -> DVec4

a * b + c rounded once, componentwise.


fract(x: Float) -> Float
fract(x: Vec2) -> Vec2
fract(x: Vec3) -> Vec3
fract(x: Vec4) -> Vec4
fract(x: Double) -> Double
fract(x: DVec2) -> DVec2
fract(x: DVec3) -> DVec3
fract(x: DVec4) -> DVec4

The fractional part, x - floor(x), componentwise.


from_bits(x: Int) -> Float

x’s 32 bits as a Float, unchanged; bits(from_bits(x)) is x.


inverse(m: Mat2) -> Mat2
inverse(m: Mat3) -> Mat3
inverse(m: Mat4) -> Mat4
inverse(m: DMat4) -> DMat4

The matrix that multiplies m to the identity: its adjugate over its determinant; a singular m gives no finite numbers.


inversesqrt(x: Float) -> Float
inversesqrt(x: Vec2) -> Vec2
inversesqrt(x: Vec3) -> Vec3
inversesqrt(x: Vec4) -> Vec4

1 / sqrt(x), componentwise.


isinf(x: Float) -> Bool

Whether x is infinite.


isnan(x: Float) -> Bool

Whether x is not a number.


length(v: Vec2) -> Float
length(v: Vec3) -> Float
length(v: Vec4) -> Float
length(v: DVec3) -> Double

The Euclidean length of a vector: sqrt(dot(v, v)).


log(x: Float) -> Float
log(x: Vec2) -> Vec2
log(x: Vec3) -> Vec3
log(x: Vec4) -> Vec4
log(x: Double) -> Double
log(x: DVec2) -> DVec2
log(x: DVec3) -> DVec3
log(x: DVec4) -> DVec4

The natural logarithm, componentwise.


log2(x: Float) -> Float
log2(x: Vec2) -> Vec2
log2(x: Vec3) -> Vec3
log2(x: Vec4) -> Vec4
log2(x: Double) -> Double
log2(x: DVec2) -> DVec2
log2(x: DVec3) -> DVec3
log2(x: DVec4) -> DVec4

The base-2 logarithm, componentwise.


max(a: Float, b: Float) -> Float
max(a: Int, b: Int) -> Int
max(a: Vec2, b: Float) -> Vec2
max(a: Vec2, b: Vec2) -> Vec2
max(a: Vec3, b: Float) -> Vec3
max(a: Vec3, b: Vec3) -> Vec3
max(a: Vec4, b: Float) -> Vec4
max(a: Vec4, b: Vec4) -> Vec4
max(a: IVec2, b: Int) -> IVec2
max(a: IVec2, b: IVec2) -> IVec2
max(a: IVec3, b: Int) -> IVec3
max(a: IVec3, b: IVec3) -> IVec3
max(a: IVec4, b: Int) -> IVec4
max(a: IVec4, b: IVec4) -> IVec4
max(a: Double, b: Double) -> Double
max(a: Long, b: Long) -> Long
max(a: DVec2, b: Double) -> DVec2
max(a: DVec2, b: DVec2) -> DVec2
max(a: DVec3, b: Double) -> DVec3
max(a: DVec3, b: DVec3) -> DVec3
max(a: DVec4, b: Double) -> DVec4
max(a: DVec4, b: DVec4) -> DVec4
max(a: LVec2, b: Long) -> LVec2
max(a: LVec2, b: LVec2) -> LVec2
max(a: LVec3, b: Long) -> LVec3
max(a: LVec3, b: LVec3) -> LVec3

The larger of a and b, componentwise; a Float beside a vector broadcasts.


min(a: Float, b: Float) -> Float
min(a: Int, b: Int) -> Int
min(a: Vec2, b: Float) -> Vec2
min(a: Vec2, b: Vec2) -> Vec2
min(a: Vec3, b: Float) -> Vec3
min(a: Vec3, b: Vec3) -> Vec3
min(a: Vec4, b: Float) -> Vec4
min(a: Vec4, b: Vec4) -> Vec4
min(a: IVec2, b: Int) -> IVec2
min(a: IVec2, b: IVec2) -> IVec2
min(a: IVec3, b: Int) -> IVec3
min(a: IVec3, b: IVec3) -> IVec3
min(a: IVec4, b: Int) -> IVec4
min(a: IVec4, b: IVec4) -> IVec4
min(a: Double, b: Double) -> Double
min(a: Long, b: Long) -> Long
min(a: DVec2, b: Double) -> DVec2
min(a: DVec2, b: DVec2) -> DVec2
min(a: DVec3, b: Double) -> DVec3
min(a: DVec3, b: DVec3) -> DVec3
min(a: DVec4, b: Double) -> DVec4
min(a: DVec4, b: DVec4) -> DVec4
min(a: LVec2, b: Long) -> LVec2
min(a: LVec2, b: LVec2) -> LVec2
min(a: LVec3, b: Long) -> LVec3
min(a: LVec3, b: LVec3) -> LVec3

The smaller of a and b, componentwise; a Float beside a vector broadcasts.


mix(a: Float, b: Float, t: Float) -> Float
mix(a: Vec2, b: Vec2, t: Float) -> Vec2
mix(a: Vec2, b: Vec2, t: Vec2) -> Vec2
mix(a: Vec3, b: Vec3, t: Float) -> Vec3
mix(a: Vec3, b: Vec3, t: Vec3) -> Vec3
mix(a: Vec4, b: Vec4, t: Float) -> Vec4
mix(a: Vec4, b: Vec4, t: Vec4) -> Vec4
mix(a: Double, b: Double, t: Double) -> Double
mix(a: DVec2, b: DVec2, t: Double) -> DVec2
mix(a: DVec2, b: DVec2, t: DVec2) -> DVec2
mix(a: DVec3, b: DVec3, t: Double) -> DVec3
mix(a: DVec3, b: DVec3, t: DVec3) -> DVec3
mix(a: DVec4, b: DVec4, t: Double) -> DVec4
mix(a: DVec4, b: DVec4, t: DVec4) -> DVec4

a + (b - a) * t, componentwise; t a Float or componentwise.


mod(x: Float, y: Float) -> Float
mod(x: Vec2, y: Vec2) -> Vec2
mod(x: Vec2, y: Float) -> Vec2
mod(x: Vec3, y: Vec3) -> Vec3
mod(x: Vec3, y: Float) -> Vec3
mod(x: Vec4, y: Vec4) -> Vec4
mod(x: Vec4, y: Float) -> Vec4

x - y * floor(x / y): the remainder with y’s sign, for wrapping coordinates, where % truncates toward zero.


mul_wrap(a: Int, b: Int) -> Int
mul_wrap(a: Long, b: Long) -> Long

The low 32 bits of a * b on Ints: never a failure, unlike *.


mulhi(a: Int, b: Int) -> Int

The high 32 bits of the signed 64-bit product of a and b.


normalize(v: Vec2) -> Vec2
normalize(v: Vec3) -> Vec3
normalize(v: Vec4) -> Vec4
normalize(v: DVec3) -> DVec3

The unit vector in v’s direction; the zero vector stays zero.


popcount(x: Int) -> Int

How many bits of x are one.


pow(base: Float, exponent: Float) -> Float
pow(base: Vec2, exponent: Float) -> Vec2
pow(base: Vec2, exponent: Vec2) -> Vec2
pow(base: Vec3, exponent: Float) -> Vec3
pow(base: Vec3, exponent: Vec3) -> Vec3
pow(base: Vec4, exponent: Float) -> Vec4
pow(base: Vec4, exponent: Vec4) -> Vec4
pow(base: Double, exponent: Double) -> Double
pow(base: DVec2, exponent: Double) -> DVec2
pow(base: DVec2, exponent: DVec2) -> DVec2
pow(base: DVec3, exponent: Double) -> DVec3
pow(base: DVec3, exponent: DVec3) -> DVec3
pow(base: DVec4, exponent: Double) -> DVec4
pow(base: DVec4, exponent: DVec4) -> DVec4

base raised to exponent, componentwise; a Float exponent broadcasts.


radians(x: Float) -> Float
radians(x: Vec2) -> Vec2
radians(x: Vec3) -> Vec3
radians(x: Vec4) -> Vec4

Degrees to radians, componentwise.


reflect(incident: Vec3, normal: Vec3) -> Vec3
reflect(incident: Vec2, normal: Vec2) -> Vec2
reflect(incident: DVec3, normal: DVec3) -> DVec3

incident reflected off the surface with unit normal normal: incident - 2 * dot(normal, incident) * normal.


refract(incident: Vec2, normal: Vec2, eta: Float) -> Vec2
refract(incident: Vec3, normal: Vec3, eta: Float) -> Vec3
refract(incident: Vec4, normal: Vec4, eta: Float) -> Vec4

incident bent through a surface with unit normal normal by the ratio of indices eta; the zero vector past total internal reflection.


rotl(x: Int, n: Int) -> Int

x’s bits rotated left by n modulo 32.


rotr(x: Int, n: Int) -> Int

x’s bits rotated right by n modulo 32.


round(x: Float) -> Float
round(x: Vec2) -> Vec2
round(x: Vec3) -> Vec3
round(x: Vec4) -> Vec4
round(x: Double) -> Double
round(x: DVec2) -> DVec2
round(x: DVec3) -> DVec3
round(x: DVec4) -> DVec4

The nearest integer, ties to even, componentwise.


saturate(x: Float) -> Float
saturate(x: Vec2) -> Vec2
saturate(x: Vec3) -> Vec3
saturate(x: Vec4) -> Vec4

x held between 0 and 1, componentwise: clamp(x, 0.0, 1.0).


sign(x: Float) -> Float
sign(x: Int) -> Int
sign(x: Vec2) -> Vec2
sign(x: Vec3) -> Vec3
sign(x: Vec4) -> Vec4
sign(x: IVec2) -> IVec2
sign(x: IVec3) -> IVec3
sign(x: IVec4) -> IVec4
sign(x: Double) -> Double
sign(x: Long) -> Long
sign(x: DVec2) -> DVec2
sign(x: DVec3) -> DVec3
sign(x: DVec4) -> DVec4
sign(x: LVec2) -> LVec2
sign(x: LVec3) -> LVec3

-1, 0 or 1 by the sign of x, componentwise; an Int stays an Int.


sin(x: Float) -> Float
sin(x: Vec2) -> Vec2
sin(x: Vec3) -> Vec3
sin(x: Vec4) -> Vec4
sin(x: Double) -> Double
sin(x: DVec2) -> DVec2
sin(x: DVec3) -> DVec3
sin(x: DVec4) -> DVec4

The sine, componentwise.


sinh(x: Float) -> Float
sinh(x: Vec2) -> Vec2
sinh(x: Vec3) -> Vec3
sinh(x: Vec4) -> Vec4
sinh(x: Double) -> Double
sinh(x: DVec2) -> DVec2
sinh(x: DVec3) -> DVec3
sinh(x: DVec4) -> DVec4

The hyperbolic sine, componentwise.


smoothstep(low: Float, high: Float, x: Float) -> Float
smoothstep(low: Float, high: Float, x: Vec2) -> Vec2
smoothstep(low: Float, high: Float, x: Vec3) -> Vec3
smoothstep(low: Float, high: Float, x: Vec4) -> Vec4
smoothstep(low: Vec2, high: Vec2, x: Vec2) -> Vec2
smoothstep(low: Vec3, high: Vec3, x: Vec3) -> Vec3
smoothstep(low: Vec4, high: Vec4, x: Vec4) -> Vec4
smoothstep(low: Double, high: Double, x: Double) -> Double
smoothstep(low: Double, high: Double, x: DVec2) -> DVec2
smoothstep(low: Double, high: Double, x: DVec3) -> DVec3
smoothstep(low: Double, high: Double, x: DVec4) -> DVec4
smoothstep(low: DVec2, high: DVec2, x: DVec2) -> DVec2
smoothstep(low: DVec3, high: DVec3, x: DVec3) -> DVec3
smoothstep(low: DVec4, high: DVec4, x: DVec4) -> DVec4

0 below low, 1 above high, a smooth curve between, componentwise; Float edges broadcast.


sqrt(x: Float) -> Float
sqrt(x: Vec2) -> Vec2
sqrt(x: Vec3) -> Vec3
sqrt(x: Vec4) -> Vec4
sqrt(x: Double) -> Double
sqrt(x: DVec2) -> DVec2
sqrt(x: DVec3) -> DVec3
sqrt(x: DVec4) -> DVec4

The square root, componentwise.


step(edge: Float, x: Float) -> Float
step(edge: Float, x: Vec2) -> Vec2
step(edge: Float, x: Vec3) -> Vec3
step(edge: Float, x: Vec4) -> Vec4
step(edge: Vec2, x: Vec2) -> Vec2
step(edge: Vec3, x: Vec3) -> Vec3
step(edge: Vec4, x: Vec4) -> Vec4
step(edge: Double, x: Double) -> Double
step(edge: Double, x: DVec2) -> DVec2
step(edge: Double, x: DVec3) -> DVec3
step(edge: Double, x: DVec4) -> DVec4
step(edge: DVec2, x: DVec2) -> DVec2
step(edge: DVec3, x: DVec3) -> DVec3
step(edge: DVec4, x: DVec4) -> DVec4

1 where x >= edge, else 0, componentwise; a Float edge broadcasts.


sub_wrap(a: Int, b: Int) -> Int
sub_wrap(a: Long, b: Long) -> Long

a - b modulo 2^32 on Ints: never a failure, unlike -.


tan(x: Float) -> Float
tan(x: Vec2) -> Vec2
tan(x: Vec3) -> Vec3
tan(x: Vec4) -> Vec4
tan(x: Double) -> Double
tan(x: DVec2) -> DVec2
tan(x: DVec3) -> DVec3
tan(x: DVec4) -> DVec4

The tangent, componentwise.


tanh(x: Float) -> Float
tanh(x: Vec2) -> Vec2
tanh(x: Vec3) -> Vec3
tanh(x: Vec4) -> Vec4
tanh(x: Double) -> Double
tanh(x: DVec2) -> DVec2
tanh(x: DVec3) -> DVec3
tanh(x: DVec4) -> DVec4

The hyperbolic tangent, componentwise.


transpose(m: Mat2) -> Mat2
transpose(m: Mat3) -> Mat3
transpose(m: Mat4) -> Mat4
transpose(m: DMat4) -> DMat4

The matrix with its rows and columns exchanged.


trunc(x: Float) -> Float
trunc(x: Vec2) -> Vec2
trunc(x: Vec3) -> Vec3
trunc(x: Vec4) -> Vec4
trunc(x: Double) -> Double
trunc(x: DVec2) -> DVec2
trunc(x: DVec3) -> DVec3
trunc(x: DVec4) -> DVec4

The integer part of x, toward zero, componentwise.


udiv(a: Int, b: Int) -> Int

The quotient of a and b as unsigned 32-bit values; a zero b is a failure, like /.


ult(a: Int, b: Int) -> Bool

Whether a is below b as unsigned 32-bit values.


umulhi(a: Int, b: Int) -> Int

The high 32 bits of the unsigned 64-bit product of a and b.


urem(a: Int, b: Int) -> Int

The remainder of a and b as unsigned 32-bit values; a zero b is a failure, like %.