SDL_fmodf(3)

✨ SDL_fmodf(3) ✨

okay bestie, welcome to the SDL3 FUNCTIONS section of the manual πŸ’– this one's a lil baby function and she's lowkey adorable, let's get into it


🌸 NAME 🌸

SDL_fmodf β€” return the floating-point remainder of x / y πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_stdinc.h>

float SDL_fmodf(float x, float y);

πŸ’… DESCRIPTION πŸ’…

So the way this works is: you divide x by y, and you get back the remainder. that's it. that's the whole vibe ✨

Here's the domain (aka what you're allowed to feed her):

  • -INF <= x <= INF
  • -INF <= y <= INF
  • y != 0

And the range (aka what she'll hand back to you):

  • -y <= z <= y
🚨 bestie, do NOT pass y = 0. the domain literally says y != 0, so like… don't. πŸ™ˆ

This function operates on single-precision floating point values, so if you're on double-precision floats you want SDL_fmod instead, okay? iykyk 🧚


πŸ“ FUNCTION PARAMETERS πŸ“

  • x β€” the numerator πŸ’œ
  • y β€” the denominator. Must not be 0. like fr fr. zero is not invited.

🌈 RETURN VALUE 🌈

Returns the remainder of x / y. slay. periodt πŸ’…


πŸ‘‘ THREAD SAFETY πŸ‘‘

It is safe to call this function from any thread. main character energy across every thread, no cap 🫢


⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0. so she's not ancient, she's just well-established ✨


πŸ’€ SEE ALSO πŸ’€


and that's the whole page, bestie!! πŸŽ€ this icon was brought to you by Simple Directmedia Layer, running SDL 3.4.18, and the page is literally just SDL_fmodf(3). go divide something and enjoy your remainder πŸ’–πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from