sdlCopysignf function

double sdlCopysignf(
  1. double x,
  2. double y
)

Copy the sign of one floating-point value to another.

The definition of copysign is that copysign(x, y) = abs(x) * sign(y).

Domain: -INF <= x <= INF, -INF <= y <= f

Range: -INF <= z <= INF

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

\param x floating point value to use as the magnitude. \param y floating point value to use as the sign. \returns the floating point value with the sign of y and the magnitude 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_copysignf \sa SDL_fabsf

extern SDL_DECLSPEC float SDLCALL SDL_copysignf(float x, float y)

Implementation

double sdlCopysignf(double x, double y) {
  final sdlCopysignfLookupFunction = libSdl3.lookupFunction<
      Float Function(Float x, Float y),
      double Function(double x, double y)>('SDL_copysignf');
  return sdlCopysignfLookupFunction(x, y);
}