1*05a0b428SJohn Marino.\" $OpenBSD: trunc.3,v 1.8 2013/08/14 06:32:29 jmc Exp $ 2*05a0b428SJohn Marino.\" 3*05a0b428SJohn Marino.\" Copyright (c) 2004, 2005 David Schultz <das@FreeBSD.org> 4*05a0b428SJohn Marino.\" All rights reserved. 5*05a0b428SJohn Marino.\" 6*05a0b428SJohn Marino.\" Redistribution and use in source and binary forms, with or without 7*05a0b428SJohn Marino.\" modification, are permitted provided that the following conditions 8*05a0b428SJohn Marino.\" are met: 9*05a0b428SJohn Marino.\" 1. Redistributions of source code must retain the above copyright 10*05a0b428SJohn Marino.\" notice, this list of conditions and the following disclaimer. 11*05a0b428SJohn Marino.\" 2. Redistributions in binary form must reproduce the above copyright 12*05a0b428SJohn Marino.\" notice, this list of conditions and the following disclaimer in the 13*05a0b428SJohn Marino.\" documentation and/or other materials provided with the distribution. 14*05a0b428SJohn Marino.\" 15*05a0b428SJohn Marino.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16*05a0b428SJohn Marino.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17*05a0b428SJohn Marino.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18*05a0b428SJohn Marino.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19*05a0b428SJohn Marino.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20*05a0b428SJohn Marino.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21*05a0b428SJohn Marino.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22*05a0b428SJohn Marino.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23*05a0b428SJohn Marino.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24*05a0b428SJohn Marino.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25*05a0b428SJohn Marino.\" SUCH DAMAGE. 26*05a0b428SJohn Marino.\" 27*05a0b428SJohn Marino.\" $FreeBSD: src/lib/msun/man/trunc.3,v 1.3 2005/06/15 19:04:04 ru Exp $ 28*05a0b428SJohn Marino.\" 29*05a0b428SJohn Marino.Dd $Mdocdate: August 14 2013 $ 30*05a0b428SJohn Marino.Dt TRUNC 3 31*05a0b428SJohn Marino.Os 32*05a0b428SJohn Marino.Sh NAME 33*05a0b428SJohn Marino.Nm trunc , 34*05a0b428SJohn Marino.Nm truncf , 35*05a0b428SJohn Marino.Nm truncl 36*05a0b428SJohn Marino.Nd nearest integral value with magnitude less than or equal to |x| 37*05a0b428SJohn Marino.Sh SYNOPSIS 38*05a0b428SJohn Marino.In math.h 39*05a0b428SJohn Marino.Ft double 40*05a0b428SJohn Marino.Fn trunc "double x" 41*05a0b428SJohn Marino.Ft float 42*05a0b428SJohn Marino.Fn truncf "float x" 43*05a0b428SJohn Marino.Ft long double 44*05a0b428SJohn Marino.Fn truncl "long double x" 45*05a0b428SJohn Marino.Sh DESCRIPTION 46*05a0b428SJohn MarinoThe 47*05a0b428SJohn Marino.Fn trunc , 48*05a0b428SJohn Marino.Fn truncf 49*05a0b428SJohn Marinoand 50*05a0b428SJohn Marino.Fn truncl 51*05a0b428SJohn Marinofunctions return the nearest integral value with magnitude less than 52*05a0b428SJohn Marinoor equal to 53*05a0b428SJohn Marino.Pf | Fa x Ns | . 54*05a0b428SJohn MarinoThey are equivalent to 55*05a0b428SJohn Marino.Fn rint , 56*05a0b428SJohn Marino.Fn rintf 57*05a0b428SJohn Marinoand 58*05a0b428SJohn Marino.Fn rintl 59*05a0b428SJohn Marinorespectively, in the rounding towards zero mode. 60*05a0b428SJohn Marino.Sh SEE ALSO 61*05a0b428SJohn Marino.Xr ceil 3 , 62*05a0b428SJohn Marino.Xr fesetround 3 , 63*05a0b428SJohn Marino.Xr floor 3 , 64*05a0b428SJohn Marino.Xr nextafter 3 , 65*05a0b428SJohn Marino.Xr rint 3 , 66*05a0b428SJohn Marino.Xr round 3 67*05a0b428SJohn Marino.Sh STANDARDS 68*05a0b428SJohn MarinoThe 69*05a0b428SJohn Marino.Fn trunc , 70*05a0b428SJohn Marino.Fn truncf 71*05a0b428SJohn Marinoand 72*05a0b428SJohn Marino.Fn truncl 73*05a0b428SJohn Marinofunctions conform to 74*05a0b428SJohn Marino.St -isoC-99 . 75