SDL_fmod(3)
β¨ SDL_fmod β¨
ok so bestie, welcome to the SDL_fmod page from the SDL3 functions manual π this is the one that gives you the floating-point remainder of x / y, and we're gonna go through it together, no stress.
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_stdinc.h>
double SDL_fmod(double x, double y);
π DESCRIPTION π
So basically it divides x by y, and returns the remainder. That's it. That's the whole vibe. π«Ά
The domain (aka the stuff you're allowed to feed it) is:
-INF <= x <= INF-INF <= y <= INFy != 0
And the range (aka what you can get back) is:
-y <= z <= y
Lowkey important: this function operates on double-precision floating point values. If you're working with single-precision floats, you want SDL_fmodf instead β don't come for me, that's just how it is. π
π FUNCTION PARAMETERS π
xβ the numerator. the top of the fraction, the main character of the division. πyβ the denominator. Must not be 0. fr fr, zero is not the move here. π
β RETURN VALUE β
Returns the remainder of x / y. slay. π
π¦ THREAD SAFETY π¦
It is safe to call this function from any thread. go off, multitask, thread it up, it's fine. β¨
π AVAILABILITY π
This function is available since SDL 3.2.0. not ancient, not brand new β just right. π§
π SEE ALSO π
reminder bestie: keepyaway from0or the whole thing falls apart. it's giving undefined behaviour energy and we do NOT want that. π
and that's the page!! mwah π this came from the Simple Directmedia Layer crew β SDL 3.4.18, dated with the SDL_fmod(3) footer vibe β love them, follow them, they ate. π«Άβ¨π
π¦ 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