SDL_copysign(3)

SDL_copysign3

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

Usage

#include "SDL3/SDL.h"

double SDL_copysign(double x, double y);

Header file

Defined in SDL3/SDL_stdinc.h

Overview

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 double-precision floating point values, use

SDL_copysignf
for single-precision floats.

Function parameters

x

floating point value to use as the magnitude.

y

floating point value to use as the sign.

Return value

Returns the floating point value with the sign of y and the magnitude of x.

Thread safety

It is safe to call this function from any thread.

Availability

This function is available since SDL 3.2.0.

From libsdl3-doc 3.2.10+ds-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.