sdlLroundf function
Round x
to the nearest integer representable as a long
Rounds x
to the nearest integer. Values halfway between integers will be
rounded away from zero.
Domain: -INF <= x <= INF
Range: MIN_LONG <= y <= MAX_LONG
This function operates on single-precision floating point values, use SDL_lroundf for double-precision floats. To get the result as a floating-point type, use SDL_roundf,
\param x floating point value.
\returns the nearest integer to x
.
\threadsafety It is safe to call this function from any thread.
\since This function is available since SDL 3.1.3.
\sa SDL_lround \sa SDL_roundf \sa SDL_floorf \sa SDL_ceilf \sa SDL_truncf
extern SDL_DECLSPEC long SDLCALL SDL_lroundf(float x)
Implementation
int sdlLroundf(double x) {
final sdlLroundfLookupFunction =
libSdl3.lookupFunction<Int32 Function(Float x), int Function(double x)>(
'SDL_lroundf');
return sdlLroundfLookupFunction(x);
}