Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libm Merge floor(3) to ceil(3).



details:   https://anonhg.NetBSD.org/src/rev/372bab4e3451
branches:  trunk
changeset: 764320:372bab4e3451
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Sat Apr 16 05:48:50 2011 +0000

description:
Merge floor(3) to ceil(3).

diffstat:

 lib/libm/Makefile    |   9 ++++---
 lib/libm/man/ceil.3  |  32 ++++++++++++++++++-------
 lib/libm/man/floor.3 |  65 ----------------------------------------------------
 3 files changed, 28 insertions(+), 78 deletions(-)

diffs (171 lines):

diff -r 815705e0ca19 -r 372bab4e3451 lib/libm/Makefile
--- a/lib/libm/Makefile Sat Apr 16 01:15:54 2011 +0000
+++ b/lib/libm/Makefile Sat Apr 16 05:48:50 2011 +0000
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.106 2011/04/13 04:57:11 jruoho Exp $
+#  $NetBSD: Makefile,v 1.107 2011/04/16 05:48:50 jruoho Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -203,7 +203,7 @@
 MAN+=  acos.3 acosh.3 asin.3 asinh.3 atan.3 atan2.3 atanh.3 \
        ceil.3 copysign.3 cos.3 cosh.3 \
        erf.3 exp.3 \
-       fabs.3 floor.3 fmod.3 frexp.3 hypot.3 ieee.3 \
+       fabs.3 fmod.3 frexp.3 hypot.3 ieee.3 \
        ieee_test.3 isinff.3 j0.3 ldexp.3 lgamma.3 lrint.3 \
        math.3 modf.3 nextafter.3 \
        remainder.3 rint.3 round.3 \
@@ -230,7 +230,9 @@
 MLINKS+=atan.3 atanf.3
 MLINKS+=atan2.3 atan2f.3
 MLINKS+=atanh.3 atanhf.3
-MLINKS+=ceil.3 ceilf.3
+MLINKS+=ceil.3 ceilf.3 \
+       ceil.3 floor.3 \
+       ceil.3 floorf.3
 MLINKS+=copysign.3 copysignf.3 \
        copysign.3 copysignl.3
 MLINKS+=cos.3 cosf.3
@@ -244,7 +246,6 @@
        exp.3 pow.3 exp.3 powf.3                                        \
        exp.3 log2.3 exp.3 log2f.3
 MLINKS+=fabs.3 fabsf.3
-MLINKS+=floor.3 floorf.3
 MLINKS+=fmod.3 fmodf.3
 MLINKS+=hypot.3 hypotf.3
 MLINKS+=ieee.3 finite.3 ieee.3 finitef.3                               \
diff -r 815705e0ca19 -r 372bab4e3451 lib/libm/man/ceil.3
--- a/lib/libm/man/ceil.3       Sat Apr 16 01:15:54 2011 +0000
+++ b/lib/libm/man/ceil.3       Sat Apr 16 05:48:50 2011 +0000
@@ -26,15 +26,17 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     from: @(#)ceil.3       5.1 (Berkeley) 5/2/91
-.\"    $NetBSD: ceil.3,v 1.17 2003/08/07 16:44:47 agc Exp $
+.\"    $NetBSD: ceil.3,v 1.18 2011/04/16 05:48:50 jruoho Exp $
 .\"
-.Dd March 10, 1994
+.Dd April 16, 2011
 .Dt CEIL 3
 .Os
 .Sh NAME
 .Nm ceil ,
-.Nm ceilf
-.Nd "round to smallest integral value greater than or equal to x"
+.Nm ceilf ,
+.Nm floor ,
+.Nm floorf
+.Nd ceiling and floor
 .Sh LIBRARY
 .Lb libm
 .Sh SYNOPSIS
@@ -43,6 +45,10 @@
 .Fn ceil "double x"
 .Ft float
 .Fn ceilf "float x"
+.Ft double
+.Fn floor "double x"
+.Ft float
+.Fn floorf "float x"
 .Sh DESCRIPTION
 The
 .Fn ceil
@@ -51,15 +57,23 @@
 functions return the smallest integral value
 greater than or equal to
 .Fa x .
+Conversely, the
+.Fn floor
+and
+.Fn floorf
+functions return the largest integral value
+less than or equal to
+.Fa x .
 .Sh SEE ALSO
 .Xr abs 3 ,
 .Xr fabs 3 ,
-.Xr floor 3 ,
-.Xr ieee 3 ,
 .Xr math 3 ,
+.Xr nextafter 3 ,
 .Xr rint 3
 .Sh STANDARDS
+The described functions conform to
+.St -isoC-99 .
+.Sh BUGS
 The
-.Fn ceil
-function conforms to
-.St -ansiC .
+.Vt long double
+variants of the functions are not yet supported.
diff -r 815705e0ca19 -r 372bab4e3451 lib/libm/man/floor.3
--- a/lib/libm/man/floor.3      Sat Apr 16 01:15:54 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-.\" Copyright (c) 1985, 1991 The Regents of the University of California.
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\"    notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\"    notice, this list of conditions and the following disclaimer in the
-.\"    documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of the University nor the names of its contributors
-.\"    may be used to endorse or promote products derived from this software
-.\"    without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\"     from: @(#)floor.3      6.5 (Berkeley) 4/19/91
-.\"    $NetBSD: floor.3,v 1.14 2003/08/07 16:44:47 agc Exp $
-.\"
-.Dd March 10, 1994
-.Dt FLOOR 3
-.Os
-.Sh NAME
-.Nm floor ,
-.Nm floorf
-.Nd round to largest integral value not greater than x
-.Sh LIBRARY
-.Lb libm
-.Sh SYNOPSIS
-.In math.h
-.Ft double
-.Fn floor "double x"
-.Ft float
-.Fn floorf "float x"
-.Sh DESCRIPTION
-The
-.Fn floor
-and
-.Fn floorf
-functions return the largest integral value
-less than or equal to
-.Fa x .
-.Sh SEE ALSO
-.Xr abs 3 ,
-.Xr ceil 3 ,
-.Xr fabs 3 ,
-.Xr ieee 3 ,
-.Xr math 3 ,
-.Xr rint 3
-.Sh STANDARDS
-The
-.Fn floor
-function conforms to
-.St -ansiC .



Home | Main Index | Thread Index | Old Index