Function SDL_truncf
pub unsafe extern "C" fn SDL_truncf(x: f32) -> f32
Available on crate feature
dep_sdl3
only.Expand description
Truncate x
to an integer.
Rounds x
to the next closest integer to 0. This is equivalent to removing
the fractional part of x
, leaving only the integer part.
Domain: -INF <= x <= INF
Range: -INF <= y <= INF
, y integer
This function operates on single-precision floating point values, use
SDL_trunc
for double-precision floats.
§Parameters
x
: floating point value.
§Return value
Returns x
truncated to an integer.
§Thread safety
It is safe to call this function from any thread.
§Availability
This function is available since SDL 3.2.0.