diff options
author | Martynas Venckus <martynas@cvs.openbsd.org> | 2009-07-29 18:43:30 +0000 |
---|---|---|
committer | Martynas Venckus <martynas@cvs.openbsd.org> | 2009-07-29 18:43:30 +0000 |
commit | 0b17118da1f4d2622b621a909089aa5018aee0b8 (patch) | |
tree | e782c9e07be0081261441b83e62389ed4a5f625c /lib | |
parent | ac24c148389b1e7d3cadced1d7cd219e3ca280a5 (diff) |
ieee, and ieeef aren't real, and the amount of functions it documents
is getting ridiculous. split them into groups of copysign, ilogb,
nextafter, scalbn. discussed long ago with millert@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libm/Makefile | 27 | ||||
-rw-r--r-- | lib/libm/man/copysign.3 | 72 | ||||
-rw-r--r-- | lib/libm/man/ilogb.3 | 79 | ||||
-rw-r--r-- | lib/libm/man/nextafter.3 | 64 | ||||
-rw-r--r-- | lib/libm/man/scalbn.3 (renamed from lib/libm/man/ieee.3) | 88 |
5 files changed, 240 insertions, 90 deletions
diff --git a/lib/libm/Makefile b/lib/libm/Makefile index 7cbb9492153..cbd7c5a80a8 100644 --- a/lib/libm/Makefile +++ b/lib/libm/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.69 2009/07/28 16:14:11 martynas Exp $ +# $OpenBSD: Makefile,v 1.70 2009/07/29 18:43:28 martynas Exp $ # $NetBSD: Makefile,v 1.28 1995/11/20 22:06:19 jtc Exp $ # # @(#)Makefile 5.1beta 93/09/24 @@ -163,16 +163,16 @@ SRCS+= ${LONG_SRCS} .endif MAN+= acos.3 acosh.3 asin.3 asinh.3 atan.3 atan2.3 atanh.3 ceil.3 \ - cos.3 cosh.3 erf.3 exp.3 fabs.3 floor.3 fmod.3 hypot.3 ieee.3 \ + cos.3 cosh.3 erf.3 exp.3 fabs.3 floor.3 fmod.3 hypot.3 \ logb.3 j0.3 lgamma.3 lrint.3 lround.3 math.3 nan.3 remainder.3 \ - rint.3 round.3 sin.3 sinh.3 sqrt.3 tan.3 tanh.3 trunc.3 + rint.3 round.3 sin.3 sinh.3 sqrt.3 tan.3 tanh.3 trunc.3 \ + copysign.3 ilogb.3 nextafter.3 scalbn.3 MLINKS+=erf.3 erfc.3 MLINKS+=exp.3 exp2.3 exp.3 expm1.3 exp.3 log.3 exp.3 log10.3 exp.3 log1p.3 \ exp.3 pow.3 MLINKS+=hypot.3 cabs.3 -MLINKS+=ieee.3 copysign.3 ieee.3 ilogb.3 ieee.3 nextafter.3 ieee.3 scalbn.3 -MLINKS+=ieee.3 scalbln.3 ieee.3 scalblnf.3 ieee.3 scalblnl.3 +MLINKS+=scalbn.3 scalbln.3 MLINKS+=logb.3 scalb.3 MLINKS+=logb.3 significand.3 MLINKS+=j0.3 j1.3 j0.3 jn.3 j0.3 y0.3 j0.3 y1.3 j0.3 yn.3 @@ -207,11 +207,11 @@ MLINKS+=floor.3 floorf.3 MLINKS+=fmod.3 fmodf.3 MLINKS+=hypot.3 cabsf.3 MLINKS+=hypot.3 hypotf.3 -MLINKS+=ieee.3 copysignf.3 -MLINKS+=ieee.3 ieeef.3 -MLINKS+=ieee.3 ilogbf.3 -MLINKS+=ieee.3 nextafterf.3 -MLINKS+=ieee.3 scalbnf.3 +MLINKS+=copysign.3 copysignf.3 +MLINKS+=ilogb.3 ilogbf.3 +MLINKS+=nextafter.3 nextafterf.3 +MLINKS+=scalbn.3 scalbnf.3 +MLINKS+=scalbln.3 scalblnf.3 MLINKS+=j0.3 j0f.3 MLINKS+=j0.3 j1f.3 MLINKS+=j0.3 jnf.3 @@ -251,9 +251,10 @@ MLINKS+=atan2.3 atan2l.3 MLINKS+=cos.3 cosl.3 MLINKS+=exp.3 exp2l.3 MLINKS+=fabs.3 fabsl.3 -MLINKS+=ieee.3 copysignl.3 -MLINKS+=ieee.3 ilogbl.3 -MLINKS+=ieee.3 scalbnl.3 +MLINKS+=copysign.3 copysignl.3 +MLINKS+=ilogb.3 ilogbl.3 +MLINKS+=scalbn.3 scalbnl.3 +MLINKS+=scalbln.3 scalblnl.3 MLINKS+=logb.3 logbl.3 MLINKS+=nan.3 nanl.3 MLINKS+=rint.3 rintl.3 diff --git a/lib/libm/man/copysign.3 b/lib/libm/man/copysign.3 new file mode 100644 index 00000000000..3a829d1275f --- /dev/null +++ b/lib/libm/man/copysign.3 @@ -0,0 +1,72 @@ +.\" $OpenBSD: copysign.3,v 1.1 2009/07/29 18:43:29 martynas Exp $ +.\" Copyright (c) 1985, 1991 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: @(#)ieee.3 6.4 (Berkeley) 5/6/91 +.\" +.Dd $Mdocdate: July 29 2009 $ +.Dt COPYSIGN 3 +.Os +.Sh NAME +.Nm copysign , +.Nm copysignf , +.Nm copysignl +.Nd copy sign +.Sh SYNOPSIS +.Fd #include <math.h> +.Ft double +.Fn copysign "double x" "double y" +.Ft float +.Fn copysignf "float x" "float y" +.Ft long double +.Fn copysignl "long double x" "long double y" +.Sh DESCRIPTION +.Fn copysign +returns +.Fa x +with its sign changed to +.Fa y Ns 's. +The +.Fn copysignf +function is a single precision version of +.Fn copysign . +The +.Fn copysignl +function is an extended precision version of +.Fn copysign . +.Sh SEE ALSO +.Xr math 3 +.Sh STANDARDS +.St -ieee754 +.Sh HISTORY +The +.Nm copysign , +.Nm copysignf , +and +.Nm copysignl +functions appeared in +.Bx 4.3 . diff --git a/lib/libm/man/ilogb.3 b/lib/libm/man/ilogb.3 new file mode 100644 index 00000000000..e460eac397d --- /dev/null +++ b/lib/libm/man/ilogb.3 @@ -0,0 +1,79 @@ +.\" $OpenBSD: ilogb.3,v 1.1 2009/07/29 18:43:29 martynas Exp $ +.\" Copyright (c) 1985, 1991 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: @(#)ieee.3 6.4 (Berkeley) 5/6/91 +.\" +.Dd $Mdocdate: July 29 2009 $ +.Dt ILOGB 3 +.Os +.Sh NAME +.Nm ilogb , +.Nm ilogbf , +.Nm ilogbl +.Nd extract exponent +.Sh SYNOPSIS +.Fd #include <math.h> +.Ft int +.Fn ilogb "double x" +.Ft int +.Fn ilogbf "float x" +.Ft int +.Fn ilogbl "long double x" +.Sh DESCRIPTION +.Fn ilogb +returns +.Fa x Ns 's exponent +.Fa n , +in integer format. +.Fn ilogb \*(Pm\*(If +returns +.Dv INT_MAX +and +.Fn ilogb 0 +returns +.Dv INT_MIN . +The +.Fn ilogbf +function is a single precision version of +.Fn ilogb . +The +.Fn ilogbl +function is an extended precision version of +.Fn ilogb . +.Sh SEE ALSO +.Xr math 3 +.Sh STANDARDS +.St -ieee754 +.Sh HISTORY +The +.Nm ilogb , +.Nm ilogbf , +and +.Nm ilogbl +functions appeared in +.Bx 4.3 . diff --git a/lib/libm/man/nextafter.3 b/lib/libm/man/nextafter.3 new file mode 100644 index 00000000000..3237437e81f --- /dev/null +++ b/lib/libm/man/nextafter.3 @@ -0,0 +1,64 @@ +.\" $OpenBSD: nextafter.3,v 1.1 2009/07/29 18:43:29 martynas Exp $ +.\" Copyright (c) 1985, 1991 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: @(#)ieee.3 6.4 (Berkeley) 5/6/91 +.\" +.Dd $Mdocdate: July 29 2009 $ +.Dt NEXTAFTER 3 +.Os +.Sh NAME +.Nm nextafter , +.Nm nextafterf +.Nd next representable value +.Sh SYNOPSIS +.Fd #include <math.h> +.Ft double +.Fn nextafter "double x" "double y" +.Ft float +.Fn nextafterf "float x" "float y" +.Sh DESCRIPTION +.Fn nextafter +returns the next machine representable number from +.Fa x +in direction +.Fa y . +The +.Fn nextafterf +function is a single precision version of +.Fn nextafter . +.Sh SEE ALSO +.Xr math 3 +.Sh STANDARDS +.St -ieee754 +.Sh HISTORY +The +.Nm nextafter , +and +.Nm nextafterf +functions appeared in +.Bx 4.3 . diff --git a/lib/libm/man/ieee.3 b/lib/libm/man/scalbn.3 index e64487fc83c..e4e4e86e623 100644 --- a/lib/libm/man/ieee.3 +++ b/lib/libm/man/scalbn.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ieee.3,v 1.18 2009/07/28 16:14:11 martynas Exp $ +.\" $OpenBSD: scalbn.3,v 1.1 2009/07/29 18:43:29 martynas Exp $ .\" Copyright (c) 1985, 1991 Regents of the University of California. .\" All rights reserved. .\" @@ -28,44 +28,20 @@ .\" .\" from: @(#)ieee.3 6.4 (Berkeley) 5/6/91 .\" -.Dd $Mdocdate: July 28 2009 $ -.Dt IEEE 3 +.Dd $Mdocdate: July 29 2009 $ +.Dt SCALBN 3 .Os .Sh NAME -.Nm copysign , -.Nm copysignf , -.Nm copysignl , -.Nm ilogb , -.Nm ilogbf , -.Nm ilogbl , -.Nm nextafter , -.Nm nextafterf , .Nm scalbln , .Nm scalblnf , .Nm scalblnl , .Nm scalbn , .Nm scalbnf , .Nm scalbnl -.Nd functions for IEEE arithmetic +.Nd adjust exponent by radix .Sh SYNOPSIS .Fd #include <math.h> .Ft double -.Fn copysign "double x" "double y" -.Ft float -.Fn copysignf "float x" "float y" -.Ft long double -.Fn copysignl "long double x" "long double y" -.Ft int -.Fn ilogb "double x" -.Ft int -.Fn ilogbf "float x" -.Ft int -.Fn ilogbl "long double x" -.Ft double -.Fn nextafter "double x" "double y" -.Ft float -.Fn nextafterf "float x" "float y" -.Ft double .Fn scalbln "double x" "long n" .Ft float .Fn scalblnf "float x" "long n" @@ -78,54 +54,6 @@ .Ft long double .Fn scalbnl "long double x" "int n" .Sh DESCRIPTION -These functions are required or recommended by -.St -ieee754 . -.Pp -.Fn copysign -returns -.Fa x -with its sign changed to -.Fa y Ns 's. -The -.Fn copysignf -function is a single precision version of -.Fn copysign . -The -.Fn copysignl -function is an extended precision version of -.Fn copysign . -.Pp -.Fn ilogb -returns -.Fa x Ns 's exponent -.Fa n , -in integer format. -.Fn ilogb \*(Pm\*(If -returns -.Dv INT_MAX -and -.Fn ilogb 0 -returns -.Dv INT_MIN . -The -.Fn ilogbf -function is a single precision version of -.Fn ilogb . -The -.Fn ilogbl -function is an extended precision version of -.Fn ilogb . -.Pp -.Fn nextafter -returns the next machine representable number from -.Fa x -in direction -.Fa y . -The -.Fn nextafterf -function is a single precision version of -.Fn nextafter . -.Pp .Fn scalbln and .Fn scalbn @@ -156,6 +84,12 @@ respectively. .St -ieee754 .Sh HISTORY The -.Nm ieee +.Nm scalbln , +.Nm scalblnf , +.Nm scalblnl , +.Nm scalbn , +.Nm scalbnf , +and +.Nm scalbnl , functions appeared in .Bx 4.3 . |