OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man3 / pow.3
index dad07b7..8e73965 100644 (file)
@@ -2,6 +2,7 @@
 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
 .\"     <mtk.manpages@gmail.com>
 .\"
 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
 .\"     <mtk.manpages@gmail.com>
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
@@ -21,6 +22,7 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" References consulted:
 .\"     Linux libc source code
 .\"
 .\" References consulted:
 .\"     Linux libc source code
@@ -30,7 +32,7 @@
 .\" Modified 1995-08-14 by Arnt Gulbrandsen <agulbra@troll.no>
 .\" Modified 2002-07-27 by Walter Harms
 .\"    (walter.harms@informatik.uni-oldenburg.de)
 .\" Modified 1995-08-14 by Arnt Gulbrandsen <agulbra@troll.no>
 .\" Modified 2002-07-27 by Walter Harms
 .\"    (walter.harms@informatik.uni-oldenburg.de)
-.TH POW 3  2008-08-10 "" "Linux Programmer's Manual"
+.TH POW 3  2014-12-31 "" "Linux Programmer's Manual"
 .SH NAME
 pow, powf, powl \- power functions
 .SH SYNOPSIS
 .SH NAME
 pow, powf, powl \- power functions
 .SH SYNOPSIS
@@ -54,14 +56,22 @@ Feature Test Macro Requirements for glibc (see
 .ad l
 .BR powf (),
 .BR powl ():
 .ad l
 .BR powf (),
 .BR powl ():
-_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
+.RS 4
+_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
+_POSIX_C_SOURCE\ >=\ 200112L;
+.br
+or
 .I cc\ -std=c99
 .I cc\ -std=c99
-.ad b
+.RE
+.ad
 .SH DESCRIPTION
 The
 .BR pow ()
 .SH DESCRIPTION
 The
 .BR pow ()
-function returns the value of \fIx\fP raised to the
-power of \fIy\fP.
+function returns the value of
+.I x
+raised to the
+power of
+.IR y .
 .SH RETURN VALUE
 On success, these functions return the value of
 .I x
 .SH RETURN VALUE
 On success, these functions return the value of
 .I x
@@ -217,7 +227,7 @@ the result is positive infinity.
 
 If
 .I x
 
 If
 .I x
-is +0 or -0,
+is +0 or \-0,
 and
 .I y
 is an odd integer less than 0,
 and
 .I y
 is an odd integer less than 0,
@@ -232,7 +242,7 @@ with the same sign as
 
 If
 .I x
 
 If
 .I x
-is +0 or -0,
+is +0 or \-0,
 and
 .I y
 is less than 0 and not an odd integer,
 and
 .I y
 is less than 0 and not an odd integer,
@@ -284,7 +294,6 @@ Pole error: \fIx\fP is zero, and \fIy\fP is negative
 is set to
 .BR ERANGE
 (but see BUGS).
 is set to
 .BR ERANGE
 (but see BUGS).
-.\" FIXME . glibc 2.8 gives EDOM
 A divide-by-zero floating-point exception
 .RB ( FE_DIVBYZERO )
 is raised.
 A divide-by-zero floating-point exception
 .RB ( FE_DIVBYZERO )
 is raised.
@@ -304,22 +313,39 @@ is set to
 An underflow floating-point exception
 .RB ( FE_UNDERFLOW )
 is raised.
 An underflow floating-point exception
 .RB ( FE_UNDERFLOW )
 is raised.
-.SH "CONFORMING TO"
+.SH CONFORMING TO
 C99, POSIX.1-2001.
 The variant returning
 .I double
 also conforms to
 SVr4, 4.3BSD, C89.
 .SH BUGS
 C99, POSIX.1-2001.
 The variant returning
 .I double
 also conforms to
 SVr4, 4.3BSD, C89.
 .SH BUGS
-For a pole error,
+On 64-bits,
+.\"
+.\" https://sourceware.org/bugzilla/show_bug.cgi?id=13932
+.BR pow ()
+may be more than 10,000 times slower for some (rare) inputs
+than for other nearby inputs.
+This affects only
+.BR pow (),
+and not
+.BR powf ()
+nor
+.BR powl ().
+
+In glibc 2.9 and earlier,
 .\"
 .\"
-.\" FIXME . this is as at glibc 2.8; check later if this bug is fixed
-.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776
+.\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776
+when a pole error occurs,
 .I errno
 is set to
 .I errno
 is set to
-.BR EDOM ;
-POSIX.1 says it should be set to
+.BR EDOM
+instead of the POSIX-mandated
 .BR ERANGE .
 .BR ERANGE .
+Since version 2.10,
+.\" or possibly 2.9, I haven't found the source code change
+.\" and I don't have a 2.9 system to test
+glibc does the right thing.
 
 If
 .I x
 
 If
 .I x
@@ -349,7 +375,16 @@ when an overflow or underflow error occurs, glibc's
 generates a bogus invalid floating-point exception
 .RB ( FE_INVALID )
 in addition to the overflow or underflow exception.
 generates a bogus invalid floating-point exception
 .RB ( FE_INVALID )
 in addition to the overflow or underflow exception.
-.SH "SEE ALSO"
+.SH SEE ALSO
 .BR cbrt (3),
 .BR cpow (3),
 .BR sqrt (3)
 .BR cbrt (3),
 .BR cpow (3),
 .BR sqrt (3)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.