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