SDL_log10(3)

πŸ’– SDL_log10 β€” it's giving math, bestie πŸ’–

okay so you found yourself in the SDL3 FUNCTIONS section of the manual, staring at SDL_log10(3), and honestly? slay. let's get into it.


✨ NAME ✨

SDL_log10 β€” Compute the base-10 logarithm of x.

like. the log base ten. the one your calculator has a button for. that one. πŸŽ€


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_stdinc.h>

double SDL_log10(double x);

πŸ¦‹ DESCRIPTION πŸ¦‹

Domain: 0 < x <= INF

Range: -INF <= y <= INF

bestie. listen. it is an error for x to be less than or equal to 0. not "a little weird", not "eh it'll be fine" β€” an actual error. do not pass it a zero. do not pass it a negative. i am begging. πŸ’€

This function operates on double-precision floating point values, so if you're out here working with single-precision floats, use SDL_log10f instead. she's the float version. different girl, same vibe. ✨

Also, real talk: this function may use a different approximation across different versions, platforms and configurations. which means it can literally return a different value given the same input on different machines or operating systems, or if SDL gets updated. so don't go comparing outputs across boxes and having a meltdown. it's not a bug, it's just how she moves. 🫢


πŸ‘‘ FUNCTION PARAMETERS πŸ‘‘

  • x β€” floating point value. Must be greater than 0. that's it. that's the whole requirement. but it IS a requirement. 😭

⭐ RETURN VALUE ⭐

Returns the logarithm of x. iconic behaviour, no notes. πŸ’…


🌈 THREAD SAFETY 🌈

It is safe to call this function from any thread. go forth. spawn threads. she can handle it. main character energy fr fr. πŸ’œ


🧚 AVAILABILITY 🧚

This function is available since SDL 3.2.0. so if you're on something older, that's a you problem, bestie. upgrade. πŸ“


πŸ”₯ SEE ALSO πŸ”₯

iykyk. go read those next. ✨


and that's the whole page, no cap. every option, every bound, every vibe β€” preserved. periodt. πŸ’–

okay bye ily, this was Simple Directmedia Layer's SDL 3.4.18 release of the page, brought to you by the letter S, the letter D, and the letter L. πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from