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