sdlFabs function

double sdlFabs(
  1. double x
)

Compute the absolute value of x

Domain: -INF <= x <= INF

Range: 0 <= y <= INF

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

\param x floating point value to use as the magnitude. \returns the absolute value of x.

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

\since This function is available since SDL 3.1.3.

\sa SDL_fabsf

extern SDL_DECLSPEC double SDLCALL SDL_fabs(double x)

Implementation

double sdlFabs(double x) {
  final sdlFabsLookupFunction = libSdl3.lookupFunction<
      Double Function(Double x), double Function(double x)>('SDL_fabs');
  return sdlFabsLookupFunction(x);
}