package core:math
Overview
Typical trignometric and other basic math routines.
Packages 10
| big | Arbitrary precision integers and rationals. | |
| bits | Bit-level operations, including the ability to set or toggle individual bits in an integer. | |
| cmplx | Trigonometric and other mathematic operations on complex numbers. | |
| ease | Easing procedures used for animations. | |
| fixed | Fixed-point rational numbers and conversion to/from f64. | |
| linalg | Linear algebra procedures useful for 3D spatial transformations. | |
| linalg/glsl | GLSL-like mathematics library plus numerous other utility procedures. | |
| linalg/hlsl | HLSL-like mathematics library plus numerous other utility procedures. | |
| noise | OpenSimplex2 noise algorithm. | |
| rand | Random number generators. |
Index
Types (1)
Constants (74)
- DEG_PER_RAD
- E
- LN10
- LN2
NEG_… (3)
- PI
- RAD_PER_DEG
SQRT_… (3)
- TAU
- e
- π
- τ
Variables (0)
This section is empty.
Procedures (471)
- abs
- acosh
- angle_diff
- angle_lerp
- asinh
- atan
- atanh
- bias
- binomial
- clamp
- cosh
- count_digits_of_base
- cumsum
- cumsum_inplace
- divmod
erfc_… (7)
- factorial
- gain
- gcd
- lcm
- lerp
- max
- min
- next_power_of_two
- prod
- remap
- remap_clamped
- saturate
sign_… (38)
- sign_bit_f16
- sign_bit_f16be
- sign_bit_f16le
- sign_bit_f32
- sign_bit_f32be
- sign_bit_f32le
- sign_bit_f64
- sign_bit_f64be
- sign_bit_f64le
- sign_bit_i16
- sign_bit_i16be
- sign_bit_i16le
- sign_bit_i32
- sign_bit_i32be
- sign_bit_i32le
- sign_bit_i64
- sign_bit_i64be
- sign_bit_i64le
- sign_bit_int
- sign_f16
- sign_f16be
- sign_f16le
- sign_f32
- sign_f32be
- sign_f32le
- sign_f64
- sign_f64be
- sign_f64le
- sign_i16
- sign_i16be
- sign_i16le
- sign_i32
- sign_i32be
- sign_i32le
- sign_i64
- sign_i64be
- sign_i64le
- sign_int
- sinh
- smoothstep
- step
- sum
- tanh
to_… (18)
- unlerp
- wrap
Procedure Groups (45)
Types
Float_Class ¶
Float_Class :: enum int { Normal, // an ordinary nonzero floating point value Subnormal, // a subnormal floating point value Zero, // zero Neg_Zero, // the negative zero NaN, // Not-A-Number (NaN) Inf, // positive infinity Neg_Inf, // negative infinity }
Related Procedures With Returns
Constants
DEG_PER_RAD ¶
DEG_PER_RAD :: 360.0 / TAU
E ¶
E :: 2.71828182845904523536
F16_BIAS ¶
F16_BIAS :: 0xf
F16_DIG ¶
F16_DIG :: 3
F16_EPSILON ¶
F16_EPSILON :: 0.00097656
F16_GUARD ¶
F16_GUARD :: 0
F16_MANT_DIG ¶
F16_MANT_DIG :: 11
F16_MASK ¶
F16_MASK :: 0x1f
F16_MAX ¶
F16_MAX :: 65504.0
F16_MAX_10_EXP ¶
F16_MAX_10_EXP :: 4
F16_MAX_EXP ¶
F16_MAX_EXP :: 15
F16_MIN ¶
F16_MIN :: 6.10351562e-5
F16_MIN_10_EXP ¶
F16_MIN_10_EXP :: -4
F16_MIN_EXP ¶
F16_MIN_EXP :: -14
F16_NORMALIZE ¶
F16_NORMALIZE :: 0
F16_RADIX ¶
F16_RADIX :: 2
F16_ROUNDS ¶
F16_ROUNDS :: 1
F16_SHIFT ¶
F16_SHIFT :: 16 - 6
F32_BIAS ¶
F32_BIAS :: 0x7f
F32_DIG ¶
F32_DIG :: 6
F32_EPSILON ¶
F32_EPSILON :: 1.192092896e-07
F32_GUARD ¶
F32_GUARD :: 0
F32_MANT_DIG ¶
F32_MANT_DIG :: 24
F32_MASK ¶
F32_MASK :: 0xff
F32_MAX ¶
F32_MAX :: 3.402823466e+38
F32_MAX_10_EXP ¶
F32_MAX_10_EXP :: 38
F32_MAX_EXP ¶
F32_MAX_EXP :: 128
F32_MIN ¶
F32_MIN :: 1.175494351e-38
F32_MIN_10_EXP ¶
F32_MIN_10_EXP :: -37
F32_MIN_EXP ¶
F32_MIN_EXP :: -125
F32_NORMALIZE ¶
F32_NORMALIZE :: 0
F32_RADIX ¶
F32_RADIX :: 2
F32_ROUNDS ¶
F32_ROUNDS :: 1
F32_SHIFT ¶
F32_SHIFT :: 32 - 9
F64_BIAS ¶
F64_BIAS :: 0x3ff
F64_EPSILON ¶
F64_EPSILON :: 2.2204460492503131e-016
Smallest number such that 1.0 + F64_EPSILON != 1.0.
F64_MASK ¶
F64_MASK :: 0x7ff
F64_MAX_EXP ¶
F64_MAX_EXP :: 1024
One greater than the maximum possible base-2 exponent yielding normalized value.
F64_MIN_EXP ¶
F64_MIN_EXP :: -1021
One greater than the minimum possible base-2 exponent yielding normalized value.
F64_SHIFT ¶
F64_SHIFT :: 64 - 12
INF_F16 ¶
INF_F16 :: f16(0h7C00)
INF_F32 ¶
INF_F32 :: f32(0h7F80_0000)
INF_F64 ¶
INF_F64 :: f64(0h7FF0_0000_0000_0000)
LN10 ¶
LN10 :: 2.30258509299404568401799145468436421
LN2 ¶
LN2 :: 0.693147180559945309417232121458176568
MAX_F16_PRECISION ¶
MAX_F16_PRECISION :: 4
Maximum number of meaningful digits after the decimal point for 'f16'
MAX_F32_PRECISION ¶
MAX_F32_PRECISION :: 8
Maximum number of meaningful digits after the decimal point for 'f32'
MAX_F64_PRECISION ¶
MAX_F64_PRECISION :: 16
Maximum number of meaningful digits after the decimal point for 'f64'
NEG_INF_F16 ¶
NEG_INF_F16 :: f16(0hFC00)
NEG_INF_F32 ¶
NEG_INF_F32 :: f32(0hFF80_0000)
NEG_INF_F64 ¶
NEG_INF_F64 :: f64(0hFFF0_0000_0000_0000)
PI ¶
PI :: 3.14159265358979323846264338327950288
QNAN_F16 ¶
QNAN_F16 :: f16(0h7E01)
QNAN_F32 ¶
QNAN_F32 :: f32(0hFFC0_0001)
QNAN_F64 ¶
QNAN_F64 :: f64(0h7FF8_0000_0000_0001)
RAD_PER_DEG ¶
RAD_PER_DEG :: TAU / 360.0
SNAN_F16 ¶
SNAN_F16 :: f16(0h7C01)
SNAN_F32 ¶
SNAN_F32 :: f32(0hFF80_0001)
SNAN_F64 ¶
SNAN_F64 :: f64(0h7FF0_0000_0000_0001)
SQRT_FIVE ¶
SQRT_FIVE :: 2.23606797749978969640917366873127623
SQRT_THREE ¶
SQRT_THREE :: 1.73205080756887729352744634150587236
SQRT_TWO ¶
SQRT_TWO :: 1.41421356237309504880168872420969808
TAU ¶
TAU :: 6.28318530717958647692528676655900576
e ¶
e :: E
π ¶
π :: PI
τ ¶
τ :: TAU
Variables
This section is empty.
Procedures
abs ¶
abs returns the absolute value of passed argument.
If the argument is a complex or quaternion, this is equivalent to real(conj(value) * value).
acosh ¶
@(require_results) acosh :: proc "contextless" (y: $T) -> T {…}
angle_diff ¶
@(require_results) angle_diff :: proc "contextless" (a, b: $T) -> T {…}
angle_lerp ¶
@(require_results) angle_lerp :: proc "contextless" (a, b, t: $T) -> T {…}
asinh ¶
@(require_results) asinh :: proc "contextless" (y: $T) -> T {…}
atan ¶
@(require_results) atan :: proc "contextless" (x: $T) -> T {…}
Return the arc tangent of x, in radians. Defined on the domain of [-∞, ∞] with a range of [-π/2, π/2]
atanh ¶
@(require_results) atanh :: proc "contextless" (y: $T) -> T {…}
bias ¶
@(require_results) bias :: proc "contextless" (t, b: $T) -> T {…}
cbrt_f64 ¶
cbrt returns the cube root of x.
Special cases are:
cbrt(±0) = ±0 cbrt(±Inf) = ±Inf cbrt(NaN) = NaN
clamp ¶
clamp returns a value v clamped between minimum and maximum.
This is calculated as follows: minimum if v < minimum else maximum if v > maximum else v.
classify_f16 ¶
@(require_results) classify_f16 :: proc "contextless" (x: f16) -> Float_Class {…}
classify_f16be ¶
@(require_results) classify_f16be :: proc "contextless" (x: f16be) -> Float_Class {…}
classify_f16le ¶
@(require_results) classify_f16le :: proc "contextless" (x: f16le) -> Float_Class {…}
classify_f32 ¶
@(require_results) classify_f32 :: proc "contextless" (x: f32) -> Float_Class {…}
classify_f32be ¶
@(require_results) classify_f32be :: proc "contextless" (x: f32be) -> Float_Class {…}
classify_f32le ¶
@(require_results) classify_f32le :: proc "contextless" (x: f32le) -> Float_Class {…}
classify_f64 ¶
@(require_results) classify_f64 :: proc "contextless" (x: f64) -> Float_Class {…}
classify_f64be ¶
@(require_results) classify_f64be :: proc "contextless" (x: f64be) -> Float_Class {…}
classify_f64le ¶
@(require_results) classify_f64le :: proc "contextless" (x: f64le) -> Float_Class {…}
cosh ¶
@(require_results) cosh :: proc "contextless" (x: $T) -> T {…}
cumsum ¶
@(require_results) cumsum :: proc "contextless" (dst, src: $T/[]$E) -> T {…}
cumsum_inplace ¶
cumsum_inplace :: proc "contextless" (x: $T/[]$E) {…}
divmod ¶
@(require_results) divmod :: proc "contextless" (x, y: $T) -> (div, mod: T) {…}
floor_div ¶
@(require_results) floor_div :: proc "contextless" (x, y: $T) -> T {…}
floor_divmod ¶
@(require_results) floor_divmod :: proc "contextless" (x, y: $T) -> (div, mod: T) {…}
floor_mod ¶
@(require_results) floor_mod :: proc "contextless" (x, y: $T) -> T {…}
gain ¶
@(require_results) gain :: proc "contextless" (t, g: $T) -> T {…}
gcd ¶
@(require_results) gcd :: proc "contextless" (x, y: $T) -> T {…}
is_inf_f16 ¶
is_inf reports whether f is an infinity, according to sign. If sign > 0, is_inf reports whether f is positive infinity. If sign < 0, is_inf reports whether f is negative infinity. If sign == 0, is_inf reports whether f is either infinity.
lcm ¶
@(require_results) lcm :: proc "contextless" (x, y: $T) -> T {…}
lerp ¶
@(require_results) lerp :: proc "contextless" (a, b: $T, t: $E) -> (x: T) {…}
max ¶
max returns the maximum value of passed arguments of all the same type.
If one argument is passed and it is an enum or numeric type, then max returns the maximum value of the enum type's fields or its maximum numeric value respectively.
min ¶
min returns the minimum value of passed arguments of all the same type.
If one argument is passed and it is an enum or numeric type, then min returns the minimum value of the enum type's fields or its minimum / most negative numeric value respectively.
modf_f16 ¶
Related Procedure Groups
modf_f16be ¶
Related Procedure Groups
modf_f16le ¶
Related Procedure Groups
modf_f32 ¶
Related Procedure Groups
modf_f32be ¶
Related Procedure Groups
modf_f32le ¶
Related Procedure Groups
modf_f64 ¶
Related Procedure Groups
modf_f64be ¶
Related Procedure Groups
modf_f64le ¶
Related Procedure Groups
nan_f16be ¶
@(require_results) nan_f16be :: proc "contextless" () -> f16be {…}
nan_f16le ¶
@(require_results) nan_f16le :: proc "contextless" () -> f16le {…}
nan_f32be ¶
@(require_results) nan_f32be :: proc "contextless" () -> f32be {…}
nan_f32le ¶
@(require_results) nan_f32le :: proc "contextless" () -> f32le {…}
nan_f64be ¶
@(require_results) nan_f64be :: proc "contextless" () -> f64be {…}
nan_f64le ¶
@(require_results) nan_f64le :: proc "contextless" () -> f64le {…}
prod ¶
@(require_results) prod :: proc "contextless" (x: $T/[]$E) -> (res: E) {…}
remap ¶
@(require_results) remap :: proc "contextless" (old_value, old_min, old_max, new_min, new_max: $T) -> (x: T) {…}
remap_clamped ¶
@(require_results) remap_clamped :: proc "contextless" ( old_value, old_min, old_max, new_min, new_max: $T, ) -> (x: T) {…}
saturate ¶
@(require_results) saturate :: proc "contextless" (a: $T) -> (x: T) {…}
sinh ¶
@(require_results) sinh :: proc "contextless" (x: $T) -> T {…}
smoothstep ¶
@(require_results) smoothstep :: proc "contextless" (edge0, edge1, x: $T) -> T {…}
step ¶
@(require_results) step :: proc "contextless" (edge, x: $T) -> T {…}
sum ¶
@(require_results) sum :: proc "contextless" (x: $T/[]$E) -> (res: E) {…}
tanh ¶
@(require_results) tanh :: proc "contextless" (y: $T) -> T {…}
unlerp ¶
@(require_results) unlerp :: proc "contextless" (a, b, x: $T) -> (t: T) {…}
wrap ¶
@(require_results) wrap :: proc "contextless" (x, y: $T) -> T {…}
Procedure Groups
acos ¶
acos :: proc{ acos_f64, acos_f32, acos_f16, acos_f64le, acos_f64be, acos_f32le, acos_f32be, acos_f16le, acos_f16be, }
Return the arc cosine of x, in radians. Defined on the domain of [-1, 1] with a range of [0, π].
asin ¶
asin :: proc{ asin_f64, asin_f32, asin_f16, asin_f64le, asin_f64be, asin_f32le, asin_f32be, asin_f16le, asin_f16be, }
Return the arc sine of x, in radians. Defined on the domain of [-1, 1] with a range of [-π/2, π/2]
atan2 ¶
atan2 :: proc{ atan2_f64, atan2_f32, atan2_f16, atan2_f64le, atan2_f64be, atan2_f32le, atan2_f32be, atan2_f16le, atan2_f16be, }
Return the arc tangent of y/x in radians. Defined on the domain [-∞, ∞] for x and y with a range of [-π, π]
Special cases:
atan2(y, NaN) = NaN atan2(NaN, x) = NaN atan2(+0, x>=0) = + 0 atan2(-0, x>=0) = - 0 atan2(+0, x<=-0) = + π atan2(-0, x<=-0) = - π atan2(y>0, 0) = + π/2 atan2(y<0, 0) = - π/2 atan2(+∞, +∞) = + π/4 atan2(-∞, +∞) = - π/4 atan2(+∞, -∞) = 3π/4 atan2(-∞, -∞) = - 3π/4 atan2(y, +∞) = 0 atan2(y>0, -∞) = + π atan2(y<0, -∞) = - π atan2(+∞, x) = + π/2 atan2(-∞, x) = - π/2
cbrt ¶
cbrt :: proc{ cbrt_f16, cbrt_f16le, cbrt_f16be, cbrt_f32, cbrt_f32le, cbrt_f32be, cbrt_f64, cbrt_f64le, cbrt_f64be, }
cbrt returns the cube root of x.
Special cases are:
cbrt(±0) = ±0 cbrt(±Inf) = ±Inf cbrt(NaN) = NaN
ceil ¶
ceil :: proc{ ceil_f16, ceil_f16le, ceil_f16be, ceil_f32, ceil_f32le, ceil_f32be, ceil_f64, ceil_f64le, ceil_f64be, }
classify ¶
classify :: proc{ classify_f16, classify_f16le, classify_f16be, classify_f32, classify_f32le, classify_f32be, classify_f64, classify_f64le, classify_f64be, }
Returns the Float_Class of the value, i.e. whether normal, subnormal, zero, negative zero, NaN, infinity or
negative infinity.
copy_sign ¶
copy_sign :: proc{ copy_sign_f16, copy_sign_f16le, copy_sign_f16be, copy_sign_f32, copy_sign_f32le, copy_sign_f32be, copy_sign_f64, copy_sign_f64le, copy_sign_f64be, }
cos ¶
cos :: proc{ cos_f16, cos_f16le, cos_f16be, cos_f32, cos_f32le, cos_f32be, cos_f64, cos_f64le, cos_f64be, }
Return the cosine of θ in radians.
erfc ¶
erfc :: proc{ erfc_f16, erfc_f16le, erfc_f16be, erfc_f32, erfc_f32le, erfc_f32be, erfc_f64, }
floor ¶
floor :: proc{ floor_f16, floor_f16le, floor_f16be, floor_f32, floor_f32le, floor_f32be, floor_f64, floor_f64le, floor_f64be, }
fmuladd ¶
fmuladd :: proc{ fmuladd_f16, fmuladd_f16le, fmuladd_f16be, fmuladd_f32, fmuladd_f32le, fmuladd_f32be, fmuladd_f64, fmuladd_f64le, fmuladd_f64be, }
frexp ¶
frexp :: proc{ frexp_f16, frexp_f16le, frexp_f16be, frexp_f32, frexp_f32le, frexp_f32be, frexp_f64, frexp_f64le, frexp_f64be, }
frexp breaks the value into a normalized fraction, and an integral power of two It returns a significand and exponent satisfying x == significand * 2**exponent with the absolute value of significand in the intervalue of [0.5, 1).
Special cases:
frexp(+0) = +0, 0 frexp(-0) = -0, 0 frexp(+inf) = +inf, 0 frexp(-inf) = -inf, 0 frexp(NaN) = NaN, 0
gamma ¶
gamma :: proc{ gamma_f16, gamma_f16le, gamma_f16be, gamma_f32, gamma_f32le, gamma_f32be, gamma_f64, gamma_f64le, gamma_f64be, }
hypot ¶
hypot :: proc{ hypot_f16, hypot_f16le, hypot_f16be, hypot_f32, hypot_f32le, hypot_f32be, hypot_f64, hypot_f64le, hypot_f64be, }
hypot returns Sqrt(pp + qq), taking care to avoid unnecessary overflow and underflow.
Special cases:
hypot(±Inf, q) = +Inf hypot(p, ±Inf) = +Inf hypot(NaN, q) = NaN hypot(p, NaN) = NaN
ilogb ¶
ilogb :: proc{ ilogb_f16, ilogb_f32, ilogb_f64, ilogb_f16le, ilogb_f16be, ilogb_f32le, ilogb_f32be, ilogb_f64le, ilogb_f64be, }
is_inf ¶
is_inf :: proc{ is_inf_f16, is_inf_f16le, is_inf_f16be, is_inf_f32, is_inf_f32le, is_inf_f32be, is_inf_f64, is_inf_f64le, is_inf_f64be, }
is_nan ¶
is_nan :: proc{ is_nan_f16, is_nan_f16le, is_nan_f16be, is_nan_f32, is_nan_f32le, is_nan_f32be, is_nan_f64, is_nan_f64le, is_nan_f64be, }
ldexp ¶
ldexp :: proc{ ldexp_f16, ldexp_f16le, ldexp_f16be, ldexp_f32, ldexp_f32le, ldexp_f32be, ldexp_f64, ldexp_f64le, ldexp_f64be, }
ldexp is the inverse of frexp it returns val * 2**exp.
Special cases:
ldexp(+0, exp) = +0 ldexp(-0, exp) = -0 ldexp(+inf, exp) = +inf ldexp(-inf, exp) = -inf ldexp(NaN, exp) = NaN
lgamma ¶
lgamma :: proc{ lgamma_f16, lgamma_f16le, lgamma_f16be, lgamma_f32, lgamma_f32le, lgamma_f32be, lgamma_f64, lgamma_f64le, lgamma_f64be, }
log10 ¶
log10 :: proc{ log10_f16, log10_f16le, log10_f16be, log10_f32, log10_f32le, log10_f32be, log10_f64, log10_f64le, log10_f64be, }
log1p ¶
log1p :: proc{ log1p_f16, log1p_f32, log1p_f64, log1p_f16le, log1p_f16be, log1p_f32le, log1p_f32be, log1p_f64le, log1p_f64be, }
log2 ¶
log2 :: proc{ log2_f16, log2_f16le, log2_f16be, log2_f32, log2_f32le, log2_f32be, log2_f64, log2_f64le, log2_f64be, }
logb ¶
logb :: proc{ logb_f16, logb_f32, logb_f64, logb_f16le, logb_f16be, logb_f32le, logb_f32be, logb_f64le, logb_f64be, }
modf ¶
modf :: proc{ modf_f16, modf_f16le, modf_f16be, modf_f32, modf_f32le, modf_f32be, modf_f64, modf_f64le, modf_f64be, }
nextafter ¶
nextafter :: proc{ nextafter_f16, nextafter_f16le, nextafter_f16be, nextafter_f32, nextafter_f32le, nextafter_f32be, nextafter_f64, nextafter_f64le, nextafter_f64be, }
normalize ¶
normalize :: proc{ normalize_f16, normalize_f32, normalize_f64, normalize_f16le, normalize_f16be, normalize_f32le, normalize_f32be, normalize_f64le, normalize_f64be, }
pow10 ¶
pow10 :: proc{ pow10_f16, pow10_f16le, pow10_f16be, pow10_f32, pow10_f32le, pow10_f32be, pow10_f64, pow10_f64le, pow10_f64be, }
remainder ¶
remainder :: proc{ remainder_f16, remainder_f16le, remainder_f16be, remainder_f32, remainder_f32le, remainder_f32be, remainder_f64, remainder_f64le, remainder_f64be, }
round ¶
round :: proc{ round_f16, round_f16le, round_f16be, round_f32, round_f32le, round_f32be, round_f64, round_f64le, round_f64be, }
sign ¶
sign :: proc{ sign_f16, sign_f16le, sign_f16be, sign_f32, sign_f32le, sign_f32be, sign_f64, sign_f64le, sign_f64be, sign_int, sign_i16, sign_i16le, sign_i16be, sign_i32, sign_i32le, sign_i32be, sign_i64, sign_i64le, sign_i64be, }
sign_bit ¶
sign_bit :: proc{ sign_bit_f16, sign_bit_f16le, sign_bit_f16be, sign_bit_f32, sign_bit_f32le, sign_bit_f32be, sign_bit_f64, sign_bit_f64le, sign_bit_f64be, sign_bit_int, sign_bit_i16, sign_bit_i16le, sign_bit_i16be, sign_bit_i32, sign_bit_i32le, sign_bit_i32be, sign_bit_i64, sign_bit_i64le, sign_bit_i64be, }
sin ¶
sin :: proc{ sin_f16, sin_f16le, sin_f16be, sin_f32, sin_f32le, sin_f32be, sin_f64, sin_f64le, sin_f64be, }
Return the sine of θ in radians.
sincos ¶
sincos :: proc{ sincos_f16, sincos_f16le, sincos_f16be, sincos_f32, sincos_f32le, sincos_f32be, sincos_f64, sincos_f64le, sincos_f64be, }
split_decimal ¶
split_decimal :: proc{ modf_f16, modf_f16le, modf_f16be, modf_f32, modf_f32le, modf_f32be, modf_f64, modf_f64le, modf_f64be, }
sqrt ¶
sqrt :: proc{ sqrt_f16, sqrt_f16le, sqrt_f16be, sqrt_f32, sqrt_f32le, sqrt_f32be, sqrt_f64, sqrt_f64le, sqrt_f64be, }
tan ¶
tan :: proc{ tan_f16, tan_f16le, tan_f16be, tan_f32, tan_f32le, tan_f32be, tan_f64, tan_f64le, tan_f64be, }
Return the tangent of θ in radians.
to_degrees ¶
to_degrees :: proc{ to_degrees_f16, to_degrees_f16le, to_degrees_f16be, to_degrees_f32, to_degrees_f32le, to_degrees_f32be, to_degrees_f64, to_degrees_f64le, to_degrees_f64be, }
to_radians ¶
to_radians :: proc{ to_radians_f16, to_radians_f16le, to_radians_f16be, to_radians_f32, to_radians_f32le, to_radians_f32be, to_radians_f64, to_radians_f64le, to_radians_f64be, }
trunc ¶
trunc :: proc{ trunc_f16, trunc_f16le, trunc_f16be, trunc_f32, trunc_f32le, trunc_f32be, trunc_f64, trunc_f64le, trunc_f64be, }
Removes the fractional part of the value, i.e. rounds towards zero.
Source Files
- math.odin
- math_basic.odin
- math_cbrt.odin
- math_erf.odin
- math_gamma.odin
- math_lgamma.odin
- math_log1p.odin
- math_sincos.odin
Generation Information
Generated with odin version dev-2026-10 (vendor "odin") Windows_amd64 @ 2026-10-10 00:25:51.511820200 +0000 UTC