SDL_ceilf(3)

✨ SDL_ceilf ✨

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, page SDL_ceilf(3), where we learn how to round a lil float UP πŸ’…


🌸 NAME 🌸

SDL_ceilf β€” Compute the ceiling of x. that's it, that's the whole vibe πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_stdinc.h>

float SDL_ceilf(float x);

πŸ’– DESCRIPTION πŸ’–

okay so. The ceiling of x is the smallest integer y such that y >= x β€” i.e. x rounded up to the nearest integer. not down, not to the side, UP. she only goes up, no cap πŸ‘‘

Domain: -INF <= x <= INF

Range: -INF <= y <= INF, y integer

so literally any float can walk in the door, and what comes out is always a whole integer-looking float. iconic behavior tbh 🌈

This function operates on single-precision floating point values, so if you're out here with double-precision floats, bestie, use SDL_ceil instead. wrong tool, wrong vibe, we don't do that πŸ™ˆ


🧚 FUNCTION PARAMETERS 🧚

  • x β€” floating point value. that's the input, that's the whole snack, hand her over and she gets ceil'd ✨

πŸ’œ RETURN VALUE πŸ’œ

Returns the ceiling of x. so you give her a float, she gives you back the smallest integer that's >= x. no drama, no surprises, just math eating πŸ“


πŸŽ€ THREAD SAFETY πŸŽ€

It is safe to call this function from any thread. yes fr fr, any thread, any time, she does not care, she is unbothered and thriving πŸ’…πŸ«Ά


⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0. if you're on something older than that, girl, you're in the wrong era 😭


πŸ”₯ SEE ALSO πŸ”₯

go read those too, iykyk πŸ‘‘


mwah πŸ’‹ that's the page. brought to you by Simple Directmedia Layer, running SDL 3.4.18 β€” so go forth, ceil some floats, and slay responsibly. periodt.

πŸ“¦ where this page comes from