xref: /minix3/lib/libm/man/trunc.3 (revision 84d9c625bfea59e274550651111ae9edfdc40fbd)
1*84d9c625SLionel Sambuc.\"	$NetBSD: trunc.3,v 1.7 2013/11/13 22:11:52 wiz Exp $
22fe8fb19SBen Gras.\"
32fe8fb19SBen Gras.\" Copyright (c) 2004, 2005 David Schultz <das@FreeBSD.org>
42fe8fb19SBen Gras.\" All rights reserved.
52fe8fb19SBen Gras.\"
62fe8fb19SBen Gras.\" Redistribution and use in source and binary forms, with or without
72fe8fb19SBen Gras.\" modification, are permitted provided that the following conditions
82fe8fb19SBen Gras.\" are met:
92fe8fb19SBen Gras.\" 1. Redistributions of source code must retain the above copyright
102fe8fb19SBen Gras.\"    notice, this list of conditions and the following disclaimer.
112fe8fb19SBen Gras.\" 2. Redistributions in binary form must reproduce the above copyright
122fe8fb19SBen Gras.\"    notice, this list of conditions and the following disclaimer in the
132fe8fb19SBen Gras.\"    documentation and/or other materials provided with the distribution.
142fe8fb19SBen Gras.\"
152fe8fb19SBen Gras.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
162fe8fb19SBen Gras.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
172fe8fb19SBen Gras.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
182fe8fb19SBen Gras.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
192fe8fb19SBen Gras.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
202fe8fb19SBen Gras.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
212fe8fb19SBen Gras.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
222fe8fb19SBen Gras.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
232fe8fb19SBen Gras.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
242fe8fb19SBen Gras.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
252fe8fb19SBen Gras.\" SUCH DAMAGE.
262fe8fb19SBen Gras.\"
272fe8fb19SBen Gras.\" $FreeBSD: src/lib/msun/man/trunc.3,v 1.3 2005/06/15 19:04:04 ru Exp $
282fe8fb19SBen Gras.\"
29*84d9c625SLionel Sambuc.Dd November 13, 2013
302fe8fb19SBen Gras.Dt TRUNC 3
312fe8fb19SBen Gras.Os
322fe8fb19SBen Gras.Sh NAME
332fe8fb19SBen Gras.Nm trunc ,
34*84d9c625SLionel Sambuc.Nm truncf ,
35*84d9c625SLionel Sambuc.Nm truncl
362fe8fb19SBen Gras.Nd "nearest integral value with magnitude less than or equal to |x|"
372fe8fb19SBen Gras.Sh LIBRARY
382fe8fb19SBen Gras.Lb libm
392fe8fb19SBen Gras.Sh SYNOPSIS
402fe8fb19SBen Gras.In math.h
412fe8fb19SBen Gras.Ft double
422fe8fb19SBen Gras.Fn trunc "double x"
432fe8fb19SBen Gras.Ft float
442fe8fb19SBen Gras.Fn truncf "float x"
45*84d9c625SLionel Sambuc.Ft "long double"
46*84d9c625SLionel Sambuc.Fn truncl "long double x"
472fe8fb19SBen Gras.Sh DESCRIPTION
482fe8fb19SBen GrasThe
49*84d9c625SLionel Sambuc.Fn trunc ,
50*84d9c625SLionel Sambuc.Fn truncf ,
512fe8fb19SBen Grasand
52*84d9c625SLionel Sambuc.Fn truncl
532fe8fb19SBen Grasfunctions return the nearest integral value with magnitude less than
542fe8fb19SBen Grasor equal to
552fe8fb19SBen Gras.Pf | Fa x Ns | .
562fe8fb19SBen GrasThey are equivalent to
57*84d9c625SLionel Sambuc.Fn rint ,
58*84d9c625SLionel Sambuc.Fn rintf ,
592fe8fb19SBen Grasand
60*84d9c625SLionel Sambuc.Fn rintl
612fe8fb19SBen Grasrespectively, in the
622fe8fb19SBen Gras.Dv FP_RZ
632fe8fb19SBen Grasrounding mode.
642fe8fb19SBen Gras.Sh SEE ALSO
652fe8fb19SBen Gras.Xr ceil 3 ,
662fe8fb19SBen Gras.Xr floor 3 ,
672fe8fb19SBen Gras.Xr fpsetround 3 ,
682fe8fb19SBen Gras.Xr math 3 ,
692fe8fb19SBen Gras.Xr nextafter 3 ,
702fe8fb19SBen Gras.Xr rint 3 ,
712fe8fb19SBen Gras.Xr round 3
722fe8fb19SBen Gras.Sh STANDARDS
732fe8fb19SBen GrasThe
74*84d9c625SLionel Sambuc.Fn trunc ,
75*84d9c625SLionel Sambuc.Fn truncf ,
762fe8fb19SBen Grasand
77*84d9c625SLionel Sambuc.Fn truncl
782fe8fb19SBen Grasfunctions conform to
792fe8fb19SBen Gras.St -isoC-99 .
80