.\" Copyright (c) 1985 Regents of the University of California. .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" .\" @(#)ieee.3m 6.2 (Berkeley) 5/12/86 .\" .TH IEEE 3 "May 12, 1986" .UC 6 .SH NAME ieee, copysign, remainder, finite, logb, ilogb, scalb \- copysign, remainder, exponent manipulations .SH SYNOPSIS .nf .ft B #include double copysign(double \fIx\fP, double \fIy\fP) double remainder(double \fIx\fP, double \fIy\fP) int finite(double \fIx\fP) double logb(double \fIx\fP) double ilogb(double \fIx\fP) double scalb(double \fIx\fP, double \fIy\fP) double scalbn(double \fIx\fP, int \fIy\fP) .ft R .fi .SH DESCRIPTION These functions are required for, or recommended by the IEEE standard 754 for floating\-point arithmetic. .PP Copysign(x, y) returns x with its sign changed to y's. .PP Remainder(x, y) returns the remainder r := x \- n\(**y where n is the integer nearest the exact value of x/y; moreover if |n\|\-\|x/y|\|\ =\ \|1/2 then n is even. Consequently the remainder is computed exactly and |r|\ \(<=\ |y|/2. .PP .nf .ta \w'Finite(x)'u+1n Finite(x) = 1 just when \-Inf < x < +Inf, = 0 otherwise (when |x| = Inf or x is NaN) .DT .fi .PP Logb(x) returns x's exponent n, a signed integer converted to double\-precision floating\-point and so chosen that 1\0\(<=\0|x|/2**n\0<\02 unless x = 0 or .ig \" Minix is a (only on machines that conform to IEEE 754) .. |x| = Inf or x lies between 0 and the Underflow Threshold; see below under "BUGS". .PP Ilogb(x) is like logb(x), but better. .PP Scalb(x, n) = x\(**(2**n) computed, for integer n, without first computing 2**n. .PP Scalbn(x, n) is like scalb(x, n), but better. .PP Logb and scalb are provided in the Sun FDLIBM to pass IEEE test suites. They are not recommended. Use ilogb and scalbn instead. .SH SEE ALSO .BR floor (3), .BR math (3). .SH AUTHOR Kwok\-Choi Ng