1*df930be7Sderaadt.\" Copyright (c) 1991 The Regents of the University of California. 2*df930be7Sderaadt.\" All rights reserved. 3*df930be7Sderaadt.\" 4*df930be7Sderaadt.\" Redistribution and use in source and binary forms, with or without 5*df930be7Sderaadt.\" modification, are permitted provided that the following conditions 6*df930be7Sderaadt.\" are met: 7*df930be7Sderaadt.\" 1. Redistributions of source code must retain the above copyright 8*df930be7Sderaadt.\" notice, this list of conditions and the following disclaimer. 9*df930be7Sderaadt.\" 2. Redistributions in binary form must reproduce the above copyright 10*df930be7Sderaadt.\" notice, this list of conditions and the following disclaimer in the 11*df930be7Sderaadt.\" documentation and/or other materials provided with the distribution. 12*df930be7Sderaadt.\" 3. All advertising materials mentioning features or use of this software 13*df930be7Sderaadt.\" must display the following acknowledgement: 14*df930be7Sderaadt.\" This product includes software developed by the University of 15*df930be7Sderaadt.\" California, Berkeley and its contributors. 16*df930be7Sderaadt.\" 4. Neither the name of the University nor the names of its contributors 17*df930be7Sderaadt.\" may be used to endorse or promote products derived from this software 18*df930be7Sderaadt.\" without specific prior written permission. 19*df930be7Sderaadt.\" 20*df930be7Sderaadt.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21*df930be7Sderaadt.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22*df930be7Sderaadt.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23*df930be7Sderaadt.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24*df930be7Sderaadt.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25*df930be7Sderaadt.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26*df930be7Sderaadt.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27*df930be7Sderaadt.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28*df930be7Sderaadt.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29*df930be7Sderaadt.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30*df930be7Sderaadt.\" SUCH DAMAGE. 31*df930be7Sderaadt.\" 32*df930be7Sderaadt.\" from: @(#)fmod.3 5.1 (Berkeley) 5/2/91 33*df930be7Sderaadt.\" $Id: fmod.3,v 1.1.1.1 1995/10/18 08:42:50 deraadt Exp $ 34*df930be7Sderaadt.\" 35*df930be7Sderaadt.Dd May 2, 1991 36*df930be7Sderaadt.Dt FMOD 3 37*df930be7Sderaadt.Os 38*df930be7Sderaadt.Sh NAME 39*df930be7Sderaadt.Nm fmod 40*df930be7Sderaadt.Nd floating-point remainder function 41*df930be7Sderaadt.Sh SYNOPSIS 42*df930be7Sderaadt.Fd #include <math.h> 43*df930be7Sderaadt.Ft double 44*df930be7Sderaadt.Fn fmod "double x" "double y" 45*df930be7Sderaadt.Ft float 46*df930be7Sderaadt.Fn fmodf "float x" "float y" 47*df930be7Sderaadt.Sh DESCRIPTION 48*df930be7SderaadtThe 49*df930be7Sderaadt.Fn fmod 50*df930be7Sderaadtfunction computes the floating-point remainder of 51*df930be7Sderaadt.Fa x Ns / Fa y . 52*df930be7Sderaadt.Sh RETURN VALUES 53*df930be7SderaadtThe 54*df930be7Sderaadt.Fn fmod 55*df930be7Sderaadtand 56*df930be7Sderaadt.Fn fmodf 57*df930be7Sderaadtfunctions return the value 58*df930be7Sderaadt.Sm off 59*df930be7Sderaadt.Fa x - Em i * Fa y , 60*df930be7Sderaadt.Sm on 61*df930be7Sderaadtfor some integer 62*df930be7Sderaadt.Em i 63*df930be7Sderaadtsuch that, if 64*df930be7Sderaadt.Fa y 65*df930be7Sderaadtis non-zero, the result has the same sign as 66*df930be7Sderaadt.Fa x 67*df930be7Sderaadtand magnitude less than the magnitude of 68*df930be7Sderaadt.Fa y . 69*df930be7SderaadtIf 70*df930be7Sderaadt.Fa y 71*df930be7Sderaadtis zero, whether a domain error occurs or the 72*df930be7Sderaadt.Fn fmod 73*df930be7Sderaadtfunction returns zero is implementation-defined. 74*df930be7Sderaadt.Sh SEE ALSO 75*df930be7Sderaadt.Xr math 3 76*df930be7Sderaadt.Sh STANDARDS 77*df930be7SderaadtThe 78*df930be7Sderaadt.Fn fmod 79*df930be7Sderaadtfunction conforms to 80*df930be7Sderaadt.St -ansiC . 81