xref: /original-bsd/lib/libm/common_source/fmod.3 (revision c3e32dec)
1.\" Copyright (c) 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)fmod.3	8.1 (Berkeley) 06/04/93
7.\"
8.Dd
9.Dt FMOD 3
10.Os
11.Sh NAME
12.Nm fmod
13.Nd floating-point remainder function
14.Sh SYNOPSIS
15.Fd #include <math.h>
16.Ft double
17.Fn fmod "double x" "double y"
18.Sh DESCRIPTION
19The
20.Fn fmod
21function computes the floating-point remainder of
22.Fa x Ns / Fa y .
23.Sh RETURN VALUES
24The
25.Fn fmod
26function returns the value
27.Sm off
28.Fa x - Em i * Fa y ,
29.Sm on
30for some integer
31.Em i
32such that, if
33.Fa y
34is non-zero, the result has the same sign as
35.Fa x
36and magnitude less than the magnitude of
37.Fa y .
38If
39.Fa y
40is zero, whether a domain error occurs or the
41.Fn fmod
42function returns zero is implementation-defined.
43.Sh SEE ALSO
44.Xr math 3
45.Sh STANDARDS
46The
47.Fn fmod
48function conforms to
49.St -ansiC .
50