SDL_expf(3)

SDL_expf(3) β€” the glow-up function ✨

okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_expf πŸ’– she computes exponentials and she does it in single precision, no cap.


✨ NAME ✨

SDL_expf β€” compute the exponential of x. that's it, that's the vibe πŸ¦‹


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_stdinc.h>

float SDL_expf(float x);

πŸ’… DESCRIPTION πŸ’…

so the definition of y = exp(x) is literally y = e^x, where e is the base of the natural logarithm. iconic behavior tbh πŸŽ€ and the inverse of this whole situation is the natural logarithm, SDL_logf β€” they're giving mutuals, they're giving paired icons 🫢

  • Domain: -INF <= x <= INF
  • Range: 0 <= y <= INF
⚠️ the output will overflow if exp(x) is too large to be represented. not a drill, bestie, she will simply run out of room 😭

this function operates on single-precision floating point values. if you want double-precision floats, use SDL_exp instead β€” know the difference, iykyk πŸ’€

and okay, this next part is important so listen up: 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. so like… don't be shocked when the numbers move, it's not being shady, it's just built different on every machine 🌈


πŸ“ FUNCTION PARAMETERS πŸ“

  • x β€” floating point value. that's the input, that's the girl, she's a float πŸ’œ

πŸ‘‘ RETURN VALUE πŸ‘‘

returns the value of e^x. slay. periodt. ✨


🧚 THREAD SAFETY 🧚

it is safe to call this function from any thread. go off, multithreaded queen, no locks needed πŸ’–


⭐ AVAILABILITY ⭐

this function is available since SDL 3.2.0. vintage but still fresh πŸ¦‹


🌈 SEE ALSO 🌈

the whole logarithm-and-exponential friend group, go read them too 🫢


and that's the whole page, bestie!! this came to you from Simple Directmedia Layer, running SDL 3.4.18, and it's filed under SDL_expf(3) in your manual πŸŽ€ mwah, go compute something exponential πŸ’…βœ¨

πŸ“¦ where this page comes from