sdlTruncf function

double sdlTruncf(
  1. double x
)

Truncate x to an integer.

Rounds x to the next closest integer to 0. This is equivalent to removing the fractional part of x, leaving only the integer part.

Domain: -INF <= x <= INF

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

This function operates on single-precision floating point values, use SDL_truncf for double-precision floats.

\param x floating point value. \returns x truncated to an integer.

\threadsafety It is safe to call this function from any thread.

\since This function is available since SDL 3.1.3.

\sa SDL_trunc \sa SDL_fmodf \sa SDL_ceilf \sa SDL_floorf \sa SDL_roundf \sa SDL_lroundf

extern SDL_DECLSPEC float SDLCALL SDL_truncf(float x)

Implementation

double sdlTruncf(double x) {
  final sdlTruncfLookupFunction = libSdl3.lookupFunction<
      Float Function(Float x), double Function(double x)>('SDL_truncf');
  return sdlTruncfLookupFunction(x);
}