copysign, copysignf, copysignl , copysignd32, copysignd64, and copysignd128 Subroutines

Purpose

Perform number manipulation.

Syntax

#include <math.h>

double copysign (x, y)
double x, double y;

float copysignf (x, y)
float x, float y;

long double copysignl (x, y)
long double x, long double y;

_Decimal32 copysignd32(x, y)
_Decimal32 x;
_Decimal32 y;

_Decimal64 copysignd64(x, y)
_Decimal64 x;
_Decimal64 y;

_Decimal128 copysignd128(x, y)
_Decimal128 x;
_Decimal128 y;

Description

The copysign, copysignf, copysignl, copysignd32, copysignd64, and copysignd128 subroutines produce a value with the magnitude of x and the sign of y.

Parameters

Item Description
x Specifies the magnitude.
y Specifies the sign.

Return Values

Upon successful completion, the copysign, copysignf, copysignl, copysignd32, copysignd64, and copysignd128 subroutines return a value with a magnitude of x and a sign of y.