Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > C

copysign(3M)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

copysign(), copysignf(), copysignl(), copysignw(), copysignq() — copysign functions

SYNOPSIS

#include <math.h>

double copysign(double x, double y);

float copysignf(float x, float y);

HP Integrity Server Only

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

extended copysignw(extended x, extended y);

quad copysignq(quad x, quad y);

DESCRIPTION

The copysign() function 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.

Integrity Server Only

copysignl() is a long double version of copysign(); it takes long double arguments and returns a long double result.

copysignw() is an extended version of copysign(); it takes extended arguments and returns an extended result.

copysignq() is equivalent to copysignl() on HP-UX systems.

USAGE

To use these functions, compile either with the default -Ae option or with the -Aa and -D_HPUX_SOURCE options. To use (for Integrity servers) copysignw()or copysignq(), compile with the -fpwidetypes option. Make sure your program includes <math.h>. Link in the math library by specifying -lm on the compiler or linker command line.

RETURN VALUE

The copysign() function returns a value with the magnitude of x and the sign of y.

These functions raise no exceptions.

ERRORS

No errors are defined.

STANDARDS CONFORMANCE

copysign(), copysignf(), copysignl() : ISO/IEC C99 (including Annex F, "IEC 60559 floating-point arithmetic")

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.