SDL_powf(3)
π SDL_powf(3) β the SDL3 functions era π
okay bestie, so this one's SDL_powf, and it's giving math girlie. It's the one that raises x to the power y β yes, literally exponent math, but make it single-precision float. Let's get into it π«Ά
β¨ SYNOPSIS β¨
#include <SDL3/SDL_stdinc.h>
float SDL_powf(float x, float y);
πΈ DESCRIPTION πΈ
Domain time, no cap:
-INF <= x <= INF,-INF <= y <= INF
And the range:
-INF <= z <= INF
Little pro tip moment: if your y is the base of the natural logarithm (e), you should lowkey consider using SDL_exp instead. Like, that's the move. π
This function operates on single-precision floating point values. If you need double-precision floats, go use SDL_pow β different function, different vibe.
β οΈ okay this part is important, bestie: this function may use a different approximation across different versions, platforms and configurations. Which means it can return a different value given the same input on different machines or operating systems, or if SDL gets updated. So don't come for it if the numbers drift. It's not being shady, it's just how it is. π
π FUNCTION PARAMETERS π
xβ the base. the main character, fr fr.yβ the exponent. the one doing the lifting. πͺ
β RETURN VALUE β
Returns x raised to the power y. slay. β¨
π§ THREAD SAFETY π§
It is safe to call this function from any thread. no drama, no locks, just vibes. π
π AVAILABILITY π
This function is available since SDL 3.2.0. so if you're on something older... sorry bestie, that's a no. π
π SEE ALSO π
go read those too, iykyk π
and that's the whole page, bestie!! this was brought to you by the fine folks at Simple Directmedia Layer, living in the SDL 3.4.18 era. 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