# FreeBSD Man Pages

Man Page or Keyword Search:
Man Architecture
Apropos Keyword Search (all sections) Output format
home | help
```IEEE(3)		       FreeBSD Library Functions Manual		       IEEE(3)

NAME
copysign, copysignf, copysignl, finite, finitef, ilogb, ilogbf,
nextafter,	nextafterf, remainder, remainderf, scalbln, scalblnf, scalbn,
scalbnf --	functions for IEEE arithmetic

LIBRARY
Math Library (libm, -lm)

SYNOPSIS
#include <math.h>

double
copysign(double x,	double y);

float
copysignf(float x,	float y);

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

int
finite(double x);

int
finitef(float x);

int
ilogb(double x);

int
ilogbf(float x);

double
nextafter(double x, double	y);

float
nextafterf(float x, float y);

double
remainder(double x, double	y);

float
remainderf(float x, float y);

double
scalbln(double x, long n);

float
scalblnf(float x, long n);

double
scalbn(double x, int n);

float
scalbnf(float x, int n);

DESCRIPTION
These functions are required or recommended by IEEE Std 754-1985.

The copysign(), copysignf() and copysignl() functions return x with its
sign changed to y's.

finite() and finitef() return the value 1 just when -infinity < x <
+infinity;	otherwise a zero is returned (when |x| = infinity or x is
NaN).

ilogb() and ilogbf() return x's exponent, in integer format.
ilogb(+-infinity) returns INT_MAX,	ilogb(+-NaN) returns FP_ILOGBNAN and
ilogb(0) returns FP_ILOGB0.

nextafter() and nextafterf() return the next machine representable	number
from x in direction y.

remainder() and remainderf() return 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.	But remainder(x, 0) and	remainder(infinity, 0) are invalid
operations	that produce a NaN.

scalbln(),	scalblnf(), scalbn(), and scalbnf() return x*(2**n) computed
by	exponent manipulation.

SEE ALSO
math(3)

HISTORY
The ieee functions	appeared in 4.3BSD.  The copysignl(), scalbln(), and
scalblnf()	functions first	appeared in FreeBSD 5.3.

STANDARDS
IEEE Std 754-1985

FreeBSD	10.3			 June 20, 2004			  FreeBSD 10.3
```

NAME | LIBRARY | SYNOPSIS | DESCRIPTION | SEE ALSO | HISTORY | STANDARDS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=ieee&sektion=3&manpath=FreeBSD+5.3-RELEASE>

home | help