SDL_ceilf(3)
β¨ SDL_ceilf β¨
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, page SDL_ceilf(3), where we learn how to round a lil float UP π
πΈ NAME πΈ
SDL_ceilf β Compute the ceiling of x. that's it, that's the whole vibe π
π¦ SYNOPSIS π¦
#include <SDL3/SDL_stdinc.h>
float SDL_ceilf(float x);
π DESCRIPTION π
okay so. The ceiling of x is the smallest integer y such that y >= x β i.e. x rounded up to the nearest integer. not down, not to the side, UP. she only goes up, no cap π
Domain: -INF <= x <= INF
Range: -INF <= y <= INF, y integer
so literally any float can walk in the door, and what comes out is always a whole integer-looking float. iconic behavior tbh π
This function operates on single-precision floating point values, so if you're out here with double-precision floats, bestie, use SDL_ceil instead. wrong tool, wrong vibe, we don't do that π
π§ FUNCTION PARAMETERS π§
xβ floating point value. that's the input, that's the whole snack, hand her over and she gets ceil'd β¨
π RETURN VALUE π
Returns the ceiling of x. so you give her a float, she gives you back the smallest integer that's >= x. no drama, no surprises, just math eating π
π THREAD SAFETY π
It is safe to call this function from any thread. yes fr fr, any thread, any time, she does not care, she is unbothered and thriving π π«Ά
β AVAILABILITY β
This function is available since SDL 3.2.0. if you're on something older than that, girl, you're in the wrong era π
π₯ SEE ALSO π₯
SDL_ceil(3)β the double-precision sisterSDL_floorf(3)SDL_truncf(3)SDL_roundf(3)SDL_lroundf(3)
go read those too, iykyk π
mwah π that's the page. brought to you by Simple Directmedia Layer, running SDL 3.4.18 β so go forth, ceil some floats, and slay responsibly. periodt.
π¦ 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