·  Home
+   man pages
 -> Linux -> FreeBSD -> OpenBSD -> NetBSD -> Tru64 Unix -> HP-UX 11i -> IRIX
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

man pages->Tru64 Unix man pages -> drem (3)
 Title
 Content
 Arch
 Section All Sections 1 - General Commands 2 - System Calls 3 - Subroutines 4 - Special Files 5 - File Formats 6 - Games 7 - Macros and Conventions 8 - Maintenance Commands 9 - Kernel Interface n - New Commands

fmod(3)

```
```

NAME[Toc][Back]

```       fmod, drem, remainder - Compute the floating-point remainder

```

SYNOPSIS[Toc][Back]

```       #include <math.h>

double fmod(
double x,
double y ); float fmodf(
float x,
float y ); long double fmodl(
long double x,
long double y ); double drem(
double x,
double y ); float dremf(
float x,
float y ); long double dreml(
long double x,
long double y ); double remainder(
double x,
double y ); float remainderf(
float x,
float y ); long double remainderl(
long double x,
long double y );
```

LIBRARY[Toc][Back]

```       Math Library (libm)
```

STANDARDS[Toc][Back]

```       Interfaces documented on this reference  page  conform  to
industry standards as follows:

fmod():  XPG4

remainder():  XPG4-UNIX

about industry standards and associated tags.
```

DESCRIPTION[Toc][Back]

```       The fmod(), fmodf(),  and  fmodl()  functions  return  the
remainder  r  =  x - n*y, where n = trunc(x/y). The result
has the same sign as x and magnitude less than the  magnitude
of  y.  The remainder is computed exactly and |r| is
less than |y|.

The drem(), dremf(), dreml(),  remainder(),  remainderf(),
and  remainderl()  functions  return the remainder r = x -
n*y, where n = rint(x/y).  Additionally, if |n-  x/y|=1/2,
then n is even.  The remainder is computed exactly and |r|
is less than or equal to |y|/2.

The drem() and remainder() functions are aliases  of  each
other. The dremf(), and remainderf() functions are aliases
of each other. The dreml() and remainderl() functions  are
aliases of each other.

The   following   table  describes  function  behavior  in
response to exceptional arguments:

---------------------------------------------------------------------
Function                        Exceptional Argu-   Routine Behavior
ment
---------------------------------------------------------------------
fmod(), fmodf(), fmodl()        x = infinity        Invalid argument
fmod(), fmodf(), fmodl()        y = 0               Invalid argument
drem(), dremf(), dreml()        x = infinity        Invalid argument
drem(), dremf(), dreml()        y = 0               Invalid argument
remainder()                     x = infinity        Invalid argument
remainderf()                    x = infinity        Invalid argument
remainderl()                    x = infinity        Invalid argument
remainder()                     y = 0               Invalid argument
remainderf()                    y = 0               Invalid argument
remainderl()                    y = 0               Invalid argument
---------------------------------------------------------------------

fmod(3)
```
[ Back ]
Similar pages
 Name OS Title fmod FreeBSD floating-point remainder functions fmodf FreeBSD floating-point remainder functions fmod OpenBSD floating-point remainder functions fmodf OpenBSD floating-point remainder functions fmod Linux floating-point remainder function fmodf NetBSD floating-point remainder function drem Linux floating-point remainder function fmod NetBSD floating-point remainder function fpgetmask IRIX floating-point units set_ieee_status IRIX Restores floating-point status