SDL_floorf(3)
π SDL_floorf(3) β the SDL3 functions glow-up β¨
okay bestie, welcome to SDL_floorf from the SDL3 functions lineup π this one is short, sweet, and does exactly one thing, and honestly? she ate.
πΈ NAME πΈ
SDL_floorf β compute the floor of x. that's it. that's the whole job. no cap.
π¦ SYNOPSIS π¦
#include <SDL3/SDL_stdinc.h>
float SDL_floorf(float x);
π DESCRIPTION π
so the floor of x is the largest integer y such that y <= x β which is just a fancy way of saying you round x down to the nearest integer. it's giving "gravity but for numbers" fr fr π
Domain: -INF <= x <= INF
Range: -INF <= y <= INF, and y is an integer, periodt π
also, quick heads up: this function operates on single-precision floating point values, so if you need double-precision floats you want SDL_floor instead. don't mix them up, i'm begging π
β¨ FUNCTION PARAMETERS β¨
xβ a floating point value. that's your girl. that's the input. hand her over and she gets floored π
π«Ά RETURN VALUE π«Ά
returns the floor of x. literally just the rounded-down version of what you gave her. iconic behaviour, no notes.
π₯ THREAD SAFETY π₯
it is safe to call this function from any thread. go wild. multithread to your heart's content, she can handle it π
β AVAILABILITY β
this function is available since SDL 3.2.0. if you're on anything older, bestie, you're out of luck π
π SEE ALSO π
the whole rounding-up-and-down friend group, together at last π§β¨
and that's the tea, bestie π this little page came from Simple Directmedia Layer, version SDL 3.4.18, dated SDL_floorf(3) β mwah, love that for us. go floor something πβ¨π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms