Math

#load "std/math.bl"

std.PI

PI :: 3.141593

File: math.bl

std.TWO_PI

TWO_PI :: 6.283185

File: math.bl

std.HALF_PI

HALF_PI :: 1.570796

File: math.bl

std.F32_PI

F32_PI :: 

File: math.bl

std.F32_TWO_PI

F32_TWO_PI :: 

File: math.bl

std.F32_HALF_PI

F32_HALF_PI :: 

File: math.bl

std.F32_EPSILON

F32_EPSILON :: 0.000010

File: math.bl

std.F64_EPSILON

F64_EPSILON :: 0.000010

File: math.bl

std.S8_MIN

S8_MIN : s8 : -128

File: math.bl

std.S8_MAX

S8_MAX : s8 : 127

File: math.bl

std.S16_MIN

S16_MIN : s16 : -32768

File: math.bl

std.S16_MAX

S16_MAX : s16 : 32767

File: math.bl

std.S32_MIN

S32_MIN : s32 : -2147483648

File: math.bl

std.S32_MAX

S32_MAX : s32 : 2147483647

File: math.bl

std.S64_MIN

S64_MIN : s64 : -9223372036854775808

File: math.bl

std.S64_MAX

S64_MAX : s64 : 9223372036854775807

File: math.bl

std.U8_MIN

U8_MIN : u8 : 0

File: math.bl

std.U8_MAX

U8_MAX : u8 : 255

File: math.bl

std.U16_MIN

U16_MIN : u16 : 0

File: math.bl

std.U16_MAX

U16_MAX : u16 : 65535

File: math.bl

std.U32_MIN

U32_MIN : u32 : 0

File: math.bl

std.U32_MAX

U32_MAX : u32 : 4294967295

File: math.bl

std.U64_MIN

U64_MIN : u64 : 0

File: math.bl

std.U64_MAX

U64_MAX : u64 : 18446744073709551615

File: math.bl

std.nan

nan :: fn (T: type) T

Returns NaN for given type T.

File: math.bl

std.inf

inf :: fn (T: type) T

Returns positive infinity value for given type T.

File: math.bl

std.is_nan

is_nan :: fn (n: ?T) bool #inline

Returns true in case the input real number is NaN (i.e. result of operation 0./0.).

File: math.bl

std.is_inf

is_inf :: fn (n: ?T) bool #inline

Returns true in case the input real number is positive infinity number (i.e. result of operation 1./0.).

File: math.bl

std.is_ninf

is_ninf :: fn (n: ?T) bool #inline

Returns true in case the input real number is negative infinity number (i.e. result of operation -1./0.).

File: math.bl

std.sin

sin :: fn { 
    f32_sin; 
    f64_sin; 
}

File: math.bl

std.cos

cos :: fn { 
    f32_cos; 
    f64_cos; 
}

File: math.bl

std.floor

floor :: fn { 
    f32_floor; 
    f64_floor; 
}

File: math.bl

std.round

round :: fn { 
    f32_round; 
    f64_round; 
}

File: math.bl

std.pow

pow :: fn { 
    f32_pow; 
    f64_pow; 
}

File: math.bl

std.log

log :: fn { 
    f32_log; 
    f64_log; 
}

File: math.bl

std.log2

log2 :: fn { 
    f32_log2; 
    f64_log2; 
}

File: math.bl

std.log10

log10 :: fn { 
    f32_log10; 
    f64_log10; 
}

File: math.bl

std.sqrt

sqrt :: fn { 
    f32_sqrt; 
    f64_sqrt; 
}

File: math.bl

std.ceil

ceil :: fn { 
    f32_ceil; 
    f64_ceil; 
}

File: math.bl

std.trunc

trunc :: fn { 
    f32_trunc; 
    f64_trunc; 
}

File: math.bl

std.atan2

atan2 :: fn { 
    C.atan2f; 
    C.atan2; 
}

File: math.bl

std.copysign

copysign :: fn { 
    C.copysignf; 
    C.copysign; 
}

File: math.bl

std.asin

asin :: fn { 
    C.asinf; 
    C.asin; 
}

File: math.bl

std.acos

acos :: fn { 
    C.acosf; 
    C.acos; 
}

File: math.bl

std.tan

tan :: fn { 
    C.tanf; 
    C.tan; 
}

File: math.bl

std.atan

atan :: fn { 
    C.atanf; 
    C.atan; 
}

File: math.bl

std.fmod

fmod :: fn { 
    fn (x: f32, y: f32) f32; 
    fn (x: f64, y: f64) f64; 
}

File: math.bl

std.abs

abs :: fn { 
    f32_abs; 
    f64_abs; 
    s64_abs; 
}

File: math.bl

std.compare

compare :: fn { 
    f32_compare; 
    f64_compare; 
}

File: math.bl

std.degtorad

degtorad :: fn { 
    f32_degtorad; 
    f64_degtorad; 
}

File: math.bl

std.radtodeg

radtodeg :: fn { 
    f32_radtodeg; 
    f64_radtodeg; 
}

File: math.bl

std.max

max :: fn (a: ?T, b: T) T #inline

File: math.bl

std.min

min :: fn (a: ?T, b: T) T #inline

File: math.bl

std.lerp

lerp :: fn (a: ?T, b: T, fraction: T) T #inline

File: math.bl

std.smooth_step

smooth_step :: fn (a: ?T, b: T, fraction: T) T #inline

File: math.bl

std.clamp

clamp :: fn (v: ?T, minimum: T, maximum: T) T

File: math.bl

std.map

map :: fn (value: ?T, min1: T, max1: T, min2: T, max2: T) T #inline

File: math.bl