SDL_modff(3)
π SDL_modff(3) β the SDL3 girlies' guide to splitting floats π
okay so bestie, welcome to the SDL_modff(3) page from the SDL3 FUNCTIONS collection π this one's a lil cutie, no cap.
β¨ NAME β¨
SDL_modff β split x into integer and fractional parts π¦
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_stdinc.h>
float SDL_modff(float x, float *y);
π DESCRIPTION π
so this function is the single-precision floating point girlie πββοΈ she operates on float values only, periodt. if you're working with double-precision floats, you want her cousin SDL_modf instead, iykyk β¨
π«Ά FUNCTION PARAMETERS π«Ά
xβ your floating point value, the main character of this whole operation πyβ an output pointer, and she's where you stash the integer part ofxπ
β RETURN VALUE β
she hands you back the fractional part of x β that's the vibe π
π₯ THREAD SAFETY π₯
it is safe to call this function from any thread π― so go off, spawn whatever threads you want, she's built different fr fr
π§ AVAILABILITY π§
this function is available since SDL 3.2.0 β³ (yes she's a newer icon, respect her)
π SEE ALSO π
SDL_modf(3)β the double-precision sister πSDL_truncf(3)β when you just wanna yeet the fraction entirely πSDL_fmodf(3)β for that modulo moment π
lowkey reminder: y is a pointer, so pass her a valid address or it's giving undefined behaviour π you've been warned bestie
okay that's the whole page, and as a lil sign-off: this one comes to you from Simple Directmedia Layer, version SDL 3.4.18 β mwah, go split some floats, 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