SDL_floor(3)
π SDL_floor(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, this one's called SDL_floor and it is exactly what it sounds like β no cap π«Ά
β¨ NAME β¨
SDL_floor β compute the floor of x. that's it. that's the whole job. she's a specialist π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_stdinc.h>
double SDL_floor(double x);
look at her. one include, one function, one double in, one double out. clean girl aesthetic fr fr β¨
π¦ DESCRIPTION π¦
so the floor of x is the largest integer y such that y <= x β which is a fancy way of saying you round x down to the nearest integer. always down. never up. she does not care about your feelings about .9. π
like, 3.9 becomes 3. -2.1 becomes -3. the floor is literally the floor, you can't go below it, that's the vibe π§
Domain: -INF <= x <= INF
Range: -INF <= y <= INF, y integer
heads up bestie β this function operates on double-precision floating point values. if you're working with single-precision floats, go use SDL_floorf instead. don't mix them up, it's giving precision loss π
π FUNCTION PARAMETERS π
xβ a floating point value. that's the one getting floored. she's the main character here π
β RETURN VALUE β
returns the floor of x. literally. that's the whole return. no hidden surprises, no error codes, no drama. iconic behaviour honestly π
π THREAD SAFETY π
it is safe to call this function from any thread. go wild. spawn all the threads. she can handle it π β¨
π AVAILABILITY π
this function is available since SDL 3.2.0. so if you're on an older SDL and it's not linking, that's why bestie, not you π
π₯ SEE ALSO π₯
go read those too, they're her sisters and they all ate π«Ά
Simple Directmedia Layer β’ SDL 3.4.18 β’ SDL_floor(3)
and that's the whole page bestie, mwah π thanks for reading, now go round some numbers down, ily πβ¨
π¦ 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