Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (a - d) copysignf(3)
NAME
copysignf - Returns x with the sign of y for a float value
LIBRARY
H-series and J-series Guardian native processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcrtldll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycrtldll
SYNOPSIS
#include <math.h>
double copysignf(
float x,
float y
);
PARAMETERS
x Specifies a float value.
y Specifies a float value.
DESCRIPTION
The copysignf( ) function is a float version of the copysign( ) function; it takes float arguments
and returns a float result.
The copysignf( ) function clears the sign bit (the most significant bit) of x and ORs in the sign bit
of y. The result is x with the sign of y.
This function is recommended by the IEEE Std 754-1985 for floating-point arithmetic.
The copysignf( ) function can be called only by native processes.
NOTES
This function supports both IEEE Std 754-1985 floating-point and Tandem floating-point values.
IEEE values can include NaN and infinity, and the sign of 0 (zero) can be either positive or nega-
tive. Refer to the fp_class(3) reference page for a description of IEEE value classes.
Guardian functions are available to convert between floating-point formats. Refer to the Guar-
dian Programmer’s Guide for a discussion of floating-point conversions.
IEEE Std 754-1985 requires that copysignf(x,NaN) = ±x but says nothing else about the sign of a
return value that is a NaN.
RETURN VALUES
The copysignf( ) function returns x with the sign of y.
ERRORS
No errors can be returned. This function does not set errno.
RELATED INFORMATION
Functions: copysign(3), copysignl(3), floor(3), fp_class(3).
STANDARDS CONFORMANCE
This function conforms to the ISO/IEC 9899:1999 standard.
This function conforms to the IEEE Std 1003.1, 2004 Edition.
527187-017 Hewlett-Packard Company 1−131