12fe8fb19SBen Gras.\" Copyright (c) 1991 The Regents of the University of California. 22fe8fb19SBen Gras.\" All rights reserved. 32fe8fb19SBen Gras.\" 42fe8fb19SBen Gras.\" Redistribution and use in source and binary forms, with or without 52fe8fb19SBen Gras.\" modification, are permitted provided that the following conditions 62fe8fb19SBen Gras.\" are met: 72fe8fb19SBen Gras.\" 1. Redistributions of source code must retain the above copyright 82fe8fb19SBen Gras.\" notice, this list of conditions and the following disclaimer. 92fe8fb19SBen Gras.\" 2. Redistributions in binary form must reproduce the above copyright 102fe8fb19SBen Gras.\" notice, this list of conditions and the following disclaimer in the 112fe8fb19SBen Gras.\" documentation and/or other materials provided with the distribution. 122fe8fb19SBen Gras.\" 3. Neither the name of the University nor the names of its contributors 132fe8fb19SBen Gras.\" may be used to endorse or promote products derived from this software 142fe8fb19SBen Gras.\" without specific prior written permission. 152fe8fb19SBen Gras.\" 162fe8fb19SBen Gras.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 172fe8fb19SBen Gras.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 182fe8fb19SBen Gras.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 192fe8fb19SBen Gras.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 202fe8fb19SBen Gras.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 212fe8fb19SBen Gras.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 222fe8fb19SBen Gras.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 232fe8fb19SBen Gras.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 242fe8fb19SBen Gras.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 252fe8fb19SBen Gras.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 262fe8fb19SBen Gras.\" SUCH DAMAGE. 272fe8fb19SBen Gras.\" 282fe8fb19SBen Gras.\" from: @(#)fmod.3 5.1 (Berkeley) 5/2/91 29*84d9c625SLionel Sambuc.\" $NetBSD: fmod.3,v 1.12 2013/11/12 16:48:39 joerg Exp $ 302fe8fb19SBen Gras.\" 31*84d9c625SLionel Sambuc.Dd November 12, 2013 322fe8fb19SBen Gras.Dt FMOD 3 332fe8fb19SBen Gras.Os 342fe8fb19SBen Gras.Sh NAME 352fe8fb19SBen Gras.Nm fmod , 36*84d9c625SLionel Sambuc.Nm fmodf , 37*84d9c625SLionel Sambuc.Nm fmodl 382fe8fb19SBen Gras.Nd floating-point remainder function 392fe8fb19SBen Gras.Sh LIBRARY 402fe8fb19SBen Gras.Lb libm 412fe8fb19SBen Gras.Sh SYNOPSIS 422fe8fb19SBen Gras.In math.h 432fe8fb19SBen Gras.Ft double 442fe8fb19SBen Gras.Fn fmod "double x" "double y" 452fe8fb19SBen Gras.Ft float 462fe8fb19SBen Gras.Fn fmodf "float x" "float y" 47*84d9c625SLionel Sambuc.Ft long double 48*84d9c625SLionel Sambuc.Fn fmodl "long double x" "long double y" 492fe8fb19SBen Gras.Sh DESCRIPTION 502fe8fb19SBen GrasThe 512fe8fb19SBen Gras.Fn fmod 522fe8fb19SBen Grasfunction computes the floating-point remainder of 532fe8fb19SBen Gras.Fa x Ns / Fa y . 542fe8fb19SBen Gras.Sh RETURN VALUES 552fe8fb19SBen GrasThe 56*84d9c625SLionel Sambuc.Fn fmod , 57*84d9c625SLionel Sambuc.Fn fmodf , 582fe8fb19SBen Grasand 59*84d9c625SLionel Sambuc.Fn fmodl 602fe8fb19SBen Grasfunctions return the value 612fe8fb19SBen Gras.Sm off 622fe8fb19SBen Gras.Fa x - Em i * Fa y , 632fe8fb19SBen Gras.Sm on 642fe8fb19SBen Grasfor some integer 652fe8fb19SBen Gras.Em i 662fe8fb19SBen Grassuch that, if 672fe8fb19SBen Gras.Fa y 682fe8fb19SBen Grasis non-zero, the result has the same sign as 692fe8fb19SBen Gras.Fa x 702fe8fb19SBen Grasand magnitude less than the magnitude of 712fe8fb19SBen Gras.Fa y . 722fe8fb19SBen GrasIf 732fe8fb19SBen Gras.Fa y 742fe8fb19SBen Grasis zero, whether a domain error occurs or the 752fe8fb19SBen Gras.Fn fmod 762fe8fb19SBen Grasfunction returns zero is implementation-defined. 772fe8fb19SBen Gras.Sh SEE ALSO 782fe8fb19SBen Gras.Xr math 3 792fe8fb19SBen Gras.Sh STANDARDS 802fe8fb19SBen GrasThe 812fe8fb19SBen Gras.Fn fmod 822fe8fb19SBen Grasfunction conforms to 832fe8fb19SBen Gras.St -ansiC . 84