Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fpclassify(3M)

remainder(3M)

scalb(3M)

copysign(3M)

NAME

copysign(), copysignf() − copysign functions

SYNOPSIS

#include <math.h>

double copysign(double x, double y);

float copysignf(float x, float y);

DESCRIPTION

The copysign() function is recommended by the IEEE-754 standard for floating-point arithmetic. 

copysign() returns x with its sign changed to the sign of y.

copysignf() is a float version of copysign(); it takes float arguments and returns a float result.  To use this function, compile either with the −Ae option or with the −Aa and −D_HPUX_SOURCE options.  Otherwise, the compiler promotes the float arguments to double, and the function returns incorrect results. 

copysignf() is not specified by any standard, but it is named in accordance with the conventions specified in the "Future Library Directions" section of the ANSI C standard. 

To use these functions, link in the math library by specifying −lm on the compiler or linker command line. 

ERRORS

No errors are defined. 

SEE ALSO

fpclassify(3M), remainder(3M), scalb(3M). 

Hewlett-Packard Company  —  HP-UX Release 10.20:  July 1996

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026