sdlCopysignf function stdinc

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.2.0.

\sa SDL_copysign \sa SDL_fabsf

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

Implementation

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