12f2ee27dSDavid Schultz.\" Copyright (c) 2004, 2005 David Schultz <das@FreeBSD.org> 27ffaea80SDavid Schultz.\" All rights reserved. 37ffaea80SDavid Schultz.\" 47ffaea80SDavid Schultz.\" Redistribution and use in source and binary forms, with or without 57ffaea80SDavid Schultz.\" modification, are permitted provided that the following conditions 67ffaea80SDavid Schultz.\" are met: 77ffaea80SDavid Schultz.\" 1. Redistributions of source code must retain the above copyright 87ffaea80SDavid Schultz.\" notice, this list of conditions and the following disclaimer. 97ffaea80SDavid Schultz.\" 2. Redistributions in binary form must reproduce the above copyright 107ffaea80SDavid Schultz.\" notice, this list of conditions and the following disclaimer in the 117ffaea80SDavid Schultz.\" documentation and/or other materials provided with the distribution. 127ffaea80SDavid Schultz.\" 137ffaea80SDavid Schultz.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 147ffaea80SDavid Schultz.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 157ffaea80SDavid Schultz.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 167ffaea80SDavid Schultz.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 177ffaea80SDavid Schultz.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 187ffaea80SDavid Schultz.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 197ffaea80SDavid Schultz.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 207ffaea80SDavid Schultz.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 217ffaea80SDavid Schultz.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 227ffaea80SDavid Schultz.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 237ffaea80SDavid Schultz.\" SUCH DAMAGE. 247ffaea80SDavid Schultz.\" 252f2ee27dSDavid Schultz.Dd April 16, 2005 267ffaea80SDavid Schultz.Dt TRUNC 3 277ffaea80SDavid Schultz.Os 287ffaea80SDavid Schultz.Sh NAME 297ffaea80SDavid Schultz.Nm trunc , 302f2ee27dSDavid Schultz.Nm truncf , 312f2ee27dSDavid Schultz.Nm truncl 327ffaea80SDavid Schultz.Nd nearest integral value with magnitude less than or equal to |x| 337ffaea80SDavid Schultz.Sh LIBRARY 347ffaea80SDavid Schultz.Lb libm 357ffaea80SDavid Schultz.Sh SYNOPSIS 367ffaea80SDavid Schultz.In math.h 377ffaea80SDavid Schultz.Ft double 387ffaea80SDavid Schultz.Fn trunc "double x" 397ffaea80SDavid Schultz.Ft float 407ffaea80SDavid Schultz.Fn truncf "float x" 41f789cb82SRuslan Ermilov.Ft "long double" 422f2ee27dSDavid Schultz.Fn truncl "long double x" 437ffaea80SDavid Schultz.Sh DESCRIPTION 447ffaea80SDavid SchultzThe 452f2ee27dSDavid Schultz.Fn trunc , 462f2ee27dSDavid Schultz.Fn truncf , 477ffaea80SDavid Schultzand 482f2ee27dSDavid Schultz.Fn truncl 497ffaea80SDavid Schultzfunctions return the nearest integral value with magnitude less than 507ffaea80SDavid Schultzor equal to 517ffaea80SDavid Schultz.Pf | Fa x Ns | . 527ffaea80SDavid SchultzThey are equivalent to 532f2ee27dSDavid Schultz.Fn rint , 547ffaea80SDavid Schultz.Fn rintf , 552f2ee27dSDavid Schultzand 562f2ee27dSDavid Schultz.Fn rintl , 577ffaea80SDavid Schultzrespectively, in the 587ffaea80SDavid Schultz.Dv FE_TOWARDZERO 597ffaea80SDavid Schultzrounding mode. 607ffaea80SDavid Schultz.Sh SEE ALSO 617ffaea80SDavid Schultz.Xr ceil 3 , 627ffaea80SDavid Schultz.Xr fesetround 3 , 637ffaea80SDavid Schultz.Xr floor 3 , 647ffaea80SDavid Schultz.Xr math 3 , 657ffaea80SDavid Schultz.Xr nextafter 3 , 667ffaea80SDavid Schultz.Xr rint 3 , 677ffaea80SDavid Schultz.Xr round 3 687ffaea80SDavid Schultz.Sh STANDARDS 697ffaea80SDavid SchultzThe 702f2ee27dSDavid Schultz.Fn trunc , 712f2ee27dSDavid Schultz.Fn truncf , 727ffaea80SDavid Schultzand 732f2ee27dSDavid Schultz.Fn truncl 747ffaea80SDavid Schultzfunctions conform to 757ffaea80SDavid Schultz.St -isoC-99 . 767ffaea80SDavid Schultz.Sh HISTORY 777ffaea80SDavid SchultzThese routines first appeared in 787ffaea80SDavid Schultz.Fx 5.3 . 79