Skip to content

math.util #

fn fabs_32 #

deprecated: use math.abs instead
deprecated_after: 2022-01-19
fn fabs_32(v f32) f32

fabs_32 returns the absolute value of a as a f32 value.

Example

assert fabs_32(-2.0) == 2.0

fn fabs_64 #

deprecated: use math.abs instead
deprecated_after: 2022-01-19
fn fabs_64(v f64) f64

fabs_64 returns the absolute value of a as a f64 value.

Example

assert fabs_64(-2.0) == f64(2.0)

fn fmax_32 #

deprecated: use math.max instead
deprecated_after: 2022-01-19
fn fmax_32(a f32, b f32) f32

fmax_32 returns the largest f32 of input a and b.

Example

assert fmax_32(2.0,3.0) == 3.0

fn fmax_64 #

deprecated: use math.max instead
deprecated_after: 2022-01-19
fn fmax_64(a f64, b f64) f64

fmax_64 returns the largest f64 of input a and b.

Example

assert fmax_64(2.0,3.0) == 3.0

fn fmin_32 #

deprecated: use math.min instead
deprecated_after: 2022-01-19
fn fmin_32(a f32, b f32) f32

fmin_32 returns the smallest f32 of input a and b.

Example

assert fmin_32(2.0,3.0) == 2.0

fn fmin_64 #

deprecated: use math.min instead
deprecated_after: 2022-01-19
fn fmin_64(a f64, b f64) f64

fmin_64 returns the smallest f64 of input a and b.

Example

assert fmin_64(2.0,3.0) == 2.0

fn iabs #

deprecated: use math.abs instead
deprecated_after: 2022-01-19
fn iabs(v int) int

iabs returns an integer as absolute value

fn imax #

deprecated: use math.max instead
deprecated_after: 2022-01-19
fn imax(a int, b int) int

imin returns the biggest of two integer values

fn imin #

deprecated: use math.min instead
deprecated_after: 2022-01-19
fn imin(a int, b int) int

imin returns the smallest of two integer values

fn uabs #

deprecated: use math.abs instead
deprecated_after: 2022-01-19
fn uabs(v u32) u32

uabs returns an u32 as absolute value

fn umax #

deprecated: use math.max instead
deprecated_after: 2022-01-19
fn umax(a u32, b u32) u32

umax returns the biggest of two u32 values

fn umin #

deprecated: use math.min instead
deprecated_after: 2022-01-19
fn umin(a u32, b u32) u32

umin returns the smallest of two u32 values