diff options
author | Martynas Venckus <martynas@cvs.openbsd.org> | 2011-07-24 19:25:51 +0000 |
---|---|---|
committer | Martynas Venckus <martynas@cvs.openbsd.org> | 2011-07-24 19:25:51 +0000 |
commit | d27d78d21666f845babd72431397e91ae77fe551 (patch) | |
tree | 2f7ae773aeb545b6649d2e84a0f20195bf2fb21d | |
parent | 2e06f4f94a9818c6ad3dedf892e585fa8df211a7 (diff) |
Document fma, fmaf, fmal, nexttoward, nexttowardf, nexttowardl.
-rw-r--r-- | lib/libm/Makefile | 9 | ||||
-rw-r--r-- | lib/libm/man/fma.3 | 58 | ||||
-rw-r--r-- | lib/libm/man/nextafter.3 | 30 |
3 files changed, 80 insertions, 17 deletions
diff --git a/lib/libm/Makefile b/lib/libm/Makefile index 15fca095884..9cfe9d3f39f 100644 --- a/lib/libm/Makefile +++ b/lib/libm/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.95 2011/07/20 17:50:43 martynas Exp $ +# $OpenBSD: Makefile,v 1.96 2011/07/24 19:25:50 martynas Exp $ # $NetBSD: Makefile,v 1.28 1995/11/20 22:06:19 jtc Exp $ # # @(#)Makefile 5.1beta 93/09/24 @@ -189,7 +189,7 @@ SRCS+= ${LONG_SRCS} 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 \ fdim.3 feclearexcept.3 feenableexcept.3 fegetenv.3 \ - fegetround.3 floor.3 fmax.3 fmod.3 hypot.3 ilogb.3 j0.3 \ + fegetround.3 floor.3 fma.3 fmax.3 fmod.3 hypot.3 ilogb.3 j0.3 \ lgamma.3 logb.3 lrint.3 lround.3 nan.3 nextafter.3 \ remainder.3 rint.3 round.3 scalbn.3 sin.3 sinh.3 sqrt.3 \ tan.3 tanh.3 trunc.3 @@ -224,6 +224,7 @@ MLINKS+=logb.3 scalb.3 MLINKS+=logb.3 significand.3 MLINKS+=lrint.3 llrint.3 MLINKS+=lround.3 llround.3 +MLINKS+=nextafter.3 nexttoward.3 MLINKS+=remainder.3 drem.3 remainder.3 remquo.3 MLINKS+=rint.3 nearbyint.3 MLINKS+=scalbn.3 scalbln.3 @@ -253,6 +254,7 @@ MLINKS+=exp.3 logf.3 MLINKS+=exp.3 powf.3 MLINKS+=fdim.3 fdimf.3 MLINKS+=floor.3 floorf.3 +MLINKS+=fma.3 fmaf.3 MLINKS+=fmax.3 fmaxf.3 MLINKS+=fmax.3 fminf.3 MLINKS+=fmod.3 fmodf.3 @@ -278,6 +280,7 @@ MLINKS+=lround.3 lroundf.3 MLINKS+=nan.3 nanf.3 MLINKS+=nearbyint.3 nearbyintf.3 MLINKS+=nextafter.3 nextafterf.3 +MLINKS+=nexttoward.3 nexttowardf.3 MLINKS+=remainder.3 dremf.3 MLINKS+=remainder.3 remainderf.3 MLINKS+=remainder.3 remquof.3 @@ -340,6 +343,7 @@ MLINKS+=exp.3 logl.3 MLINKS+=exp.3 powl.3 MLINKS+=fdim.3 fdiml.3 MLINKS+=floor.3 floorl.3 +MLINKS+=fma.3 fmal.3 MLINKS+=fmax.3 fmaxl.3 MLINKS+=fmax.3 fminl.3 MLINKS+=fmod.3 fmodl.3 @@ -357,6 +361,7 @@ MLINKS+=lround.3 lroundl.3 MLINKS+=nan.3 nanl.3 MLINKS+=nearbyint.3 nearbyintl.3 MLINKS+=nextafter.3 nextafterl.3 +MLINKS+=nexttoward.3 nexttowardl.3 MLINKS+=remainder.3 remainderl.3 MLINKS+=remainder.3 remquol.3 MLINKS+=rint.3 rintl.3 diff --git a/lib/libm/man/fma.3 b/lib/libm/man/fma.3 new file mode 100644 index 00000000000..f8238d033a8 --- /dev/null +++ b/lib/libm/man/fma.3 @@ -0,0 +1,58 @@ +.\" $OpenBSD: fma.3,v 1.1 2011/07/24 19:25:50 martynas Exp $ +.\" +.\" Copyright (c) 2011 Martynas Venckus <martynas@openbsd.org> +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: July 24 2011 $ +.Dt FMA 3 +.Os +.Sh NAME +.Nm fma , +.Nm fmaf , +.Nm fmal +.Nd floating multiply-add +.Sh SYNOPSIS +.Fd #include <math.h> +.Ft double +.Fn fma "double x" "double y" "double z" +.Ft float +.Fn fmaf "float x" "float y" "float z" +.Ft long double +.Fn fmal "long double x" "long double y" "long double z" +.Sh DESCRIPTION +The +.Fn fma , +.Fn fmaf +and +.Fn fmal +functions compute (x * y) + z, rounded as one ternary operation. +The result is rounded according to the current rounding mode. +.Sh RETURN VALUES +The +.Fn fma , +.Fn fmaf +and +.Fn fmal +functions return (x * y) + z, rounded as one ternary operation. +.Sh SEE ALSO +.Xr remainder 3 , +.Xr fegetround 3 +.Sh STANDARDS +The +.Fn fma , +.Fn fmaf +and +.Fn fmal +functions conform to +.St -isoC-99 . diff --git a/lib/libm/man/nextafter.3 b/lib/libm/man/nextafter.3 index d297269fc50..5efaf720adc 100644 --- a/lib/libm/man/nextafter.3 +++ b/lib/libm/man/nextafter.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: nextafter.3,v 1.5 2011/07/07 01:34:52 martynas Exp $ +.\" $OpenBSD: nextafter.3,v 1.6 2011/07/24 19:25:50 martynas Exp $ .\" Copyright (c) 1985, 1991 Regents of the University of California. .\" All rights reserved. .\" @@ -28,13 +28,16 @@ .\" .\" from: @(#)ieee.3 6.4 (Berkeley) 5/6/91 .\" -.Dd $Mdocdate: July 7 2011 $ +.Dd $Mdocdate: July 24 2011 $ .Dt NEXTAFTER 3 .Os .Sh NAME .Nm nextafter , .Nm nextafterf , -.Nm nextafterl +.Nm nextafterl , +.Nm nexttoward , +.Nm nexttowardf , +.Nm nexttowardl , .Nd next representable value .Sh SYNOPSIS .Fd #include <math.h> @@ -44,9 +47,15 @@ .Fn nextafterf "float x" "float y" .Ft long double .Fn nextafterl "long double x" "long double y" +.Ft double +.Fn nexttoward "double x" "long double y" +.Ft float +.Fn nexttowardf "float x" "long double y" +.Ft long double +.Fn nexttowardl "long double x" "long double y" .Sh DESCRIPTION -.Fn nextafter -returns the next machine representable number from +These functions +return the next machine representable number from .Fa x in direction .Fa y . @@ -54,17 +63,8 @@ If .Fa x equals .Fa y , -.Fn nextafter -returns +these functions return .Fa y . -The -.Fn nextafterf -function is a single precision version of -.Fn nextafter . -The -.Fn nextafterl -function is an extended precision version of -.Fn nextafter . .Sh SEE ALSO .Xr nearbyint 3 .Sh STANDARDS |