SDL_lround(3)
π« SDL_lround π«
ok so bestie, welcome to the SDL_lround page from the SDL3 FUNCTIONS lineup π she rounds a double to the nearest long and honestly? she ate.
β¨ NAME β¨
SDL_lround β Round x to the nearest integer representable as a long π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_stdinc.h>
long SDL_lround(double x);
like yes that's it, that's the whole vibe π¦
π DESCRIPTION π
So what she does: rounds x to the nearest integer. And the lil plot twist β values that are halfway between integers get rounded away from zero. no indecision, no "idk maybe", she picks a side and commits π₯
Domain: -INF <= x <= INF
Range: MIN_LONG <= y <= MAX_LONG
ngl this one is the double-precision floating point girlie β¨ so if you're rolling with single-precision floats, you want SDL_lroundf instead. And if what you actually want back is a floating-point type rather than a long, then SDL_round is your bestie. iykyk π«
π FUNCTION PARAMETERS π
xβ floating point value. that's her. that's the whole input πΈ
π RETURN VALUE π
Returns the nearest integer to x. slay, no notes π
π§ THREAD SAFETY π§
It is safe to call this function from any thread. go off, multithreaded queen π
β AVAILABILITY β
This function is available since SDL 3.2.0. so if you're on something older... girl, upgrade π
π¦ SEE ALSO π¦
okay that's the whole page, mwah π this iconic lil number comes to you courtesy of Simple Directmedia Layer, version SDL 3.4.18 π«Ά go round some numbers, bestie, you got this β¨π
π¦ 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