SDL_pow(3)

πŸ’– SDL_pow(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today's main character is SDL_pow β€” yes she's raising x to the power y and she's doing it flawlessly. πŸŽ€


✨ NAME ✨

SDL_pow β€” Raise x to the power y 🫢


✨ SYNOPSIS ✨

#include <SDL3/SDL_stdinc.h>

double SDL_pow(double x, double y);

✨ DESCRIPTION ✨

So like, the domain situation is: -INF <= x <= INF, and also -INF <= y <= INF. πŸ’…

Range check: -INF <= z <= INF.

ngl, if y is the base of the natural logarithm (e), you should lowkey consider using SDL_exp instead β€” she's literally built for that. 🌸

This function operates on double-precision floating point values. If you're on that single-precision float grind, use SDL_powf instead. No cap.

⚠️ Heads up bestie, this is important: this function may use a different approximation across different versions, platforms and configurations. i.e, it can return a different value given the same input on different machines or operating systems, or if SDL is updated. It's giving "same input, different vibe" and honestly? That's just how she is. Don't come for her. 😭

✨ FUNCTION PARAMETERS ✨

  • x β€” the base. the foundation. the main character. πŸ‘‘
  • y β€” the exponent. the glow-up. the power-up. ✨

✨ RETURN VALUE ✨

Returns x raised to the power y. obsessed, fr fr. πŸ”₯


✨ THREAD SAFETY ✨

It is safe to call this function from any thread. go off, multithreaded queen. 🧚


✨ AVAILABILITY ✨

This function is available since SDL 3.2.0. so if you're on an older SDL... sorry babe, no SDL_pow for you. πŸ™ˆ


✨ SEE ALSO ✨

iykyk πŸ’œ


Simple Directmedia Layer made this one β€” SDL 3.4.18 era, to be exact. mwah, thanks for reading bestie, go raise some powers responsibly πŸ«Άβœ¨πŸ’–

πŸ“¦ where this page comes from