SDL_scalbn(3)
π SDL_scalbn β the glow-up button for your doubles π
okay bestie, so this is a page from the SDL3 FUNCTIONS manual, and today's main character is SDL_scalbn. She scales your number by a power of two. That's it. That's the whole job. And she does it flawlessly. β¨
β¨ NAME β¨
SDL_scalbn β scale x by an integer power of two. lowkey the simplest slay in the whole math library π«Ά
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_stdinc.h>
double SDL_scalbn(double x, int n);
π¦ DESCRIPTION π¦
So here's the vibe: it multiplies x by the *n*th power of the floating point radix β and the radix is always 2, no cap, every single time. π
The domain situation:
- Domain:
-INF <= x <= INF, - n integer
The range situation:
- Range:
-INF <= y <= INF
Important tea: this function operates on double-precision floating point values. If you're rocking single-precision floats, go hold hands with SDL_scalbnf instead, she's literally right there. π
π FUNCTION PARAMETERS π
xβ floating point value to be scaled.nβ integer exponent.
β RETURN VALUE β
Returns x * 2^n. That's the whole answer. Beautiful. Iconic. No notes. ππ
π THREAD SAFETY π
It is safe to call this function from any thread. Any thread. All the threads. The threads are eating good tonight. π§
π AVAILABILITY π
This function is available since SDL 3.2.0. So if you're on something older... bestie. Time to update. π
π SEE ALSO π
and that's the page, bestie!! this one came to you straight from the Simple Directmedia Layer girlies, version SDL 3.4.18 β and yeah, this manual page is literally named SDL_scalbn(3) too, we're keeping it consistent around here. go forth and scale responsibly π
β¨π«Ά
π¦ 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