Capy-Bearer Documentation

floor

lib call

Capy

function floor(value : f32) f32
function floor(value : f64) f64

Description

floor() rounds toward negative infinity: floor(-2.5) is -3.0. Convert the result with s64() when an integer is needed.

Parameters

value : a floating-point number

Return Values

The largest integral value that is not greater than value, in the same type.

Example

Capy

print(floor(2.7), " ", floor(-2.5), " ", s64(floor(9.99)), "\n")

Output

2 -3 9