Skip to contentSkip to conversation

Recently, the atanh implementation was changed, but the man seems not changed yet

DISCUSSION KOSAKI Motohiro 2 participants 3 messages Feb 18, 2010 – Sep 14, 2010 2 messages not in the archive Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

Hi Michael,

I recently found little mismatch between the impmentation and the man in atanh function.

current man page says
http://www.kernel.org/doc/man-pages/online/pages/man3/atanh.3.html

---------------------------------------------------------
BUGS
For a pole error, errno is set to EDOM; POSIX.1 says it should be set to ERANGE.
---------------------------------------------------------

but following test programs "34: Numerical result out of range". It mean atanh return ERANGE rightly.

atanh_test.c
---------------------------------------------------------
#include <math.h>
#include <stdio.h>
#include <sys/errno.h>
#include <string.h>

int main(void)

{
        double d;

        d = atanh(1.0);
        if (d == HUGE_VAL)
                printf("huge %d: %s\n", errno, strerror(errno));
        else
                printf("Oops no error\n");

        return 0;
}

---------------------------------------------------------

I dug in glibc's ChangeLog and I found following change. So, can we consider to change the man too?

---------------------------------------------------------
2009-04-26 Ulrich Drepper <[email protected]>

* sysdeps/ieee754/dbl-64/s_expm1.c: Set errno for overflow.
* sysdeps/ieee754/flt-32/s_expm1f.c: Likewise.
* sysdeps/x86_64/fpu/s_expm1l.S: Likewise.

* sysdeps/ieee754/k_standard.c (__kernel_standard): Pole errors in atanh should set ERANGE.

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
In reply to a message not in the archive

Hello Motohiro,

Quoted 47 lines · KOSAKI Motohiro

Hi Michael,

I recently found little mismatch between the impmentation and the man in atanh function.

current man page says
http://www.kernel.org/doc/man-pages/online/pages/man3/atanh.3.html

---------------------------------------------------------
BUGS
      For a pole error, errno is set to EDOM; POSIX.1 says it should be set to ERANGE.
---------------------------------------------------------

but following test programs "34: Numerical result out of range". It mean atanh return ERANGE rightly.

atanh_test.c
---------------------------------------------------------
#include <math.h>
#include <stdio.h>
#include <sys/errno.h>
#include <string.h>

int main(void)
{
       double d;

       d = atanh(1.0);
       if (d == HUGE_VAL)
               printf("huge %d: %s\n", errno, strerror(errno)); else
               printf("Oops no error\n");

       return 0;
}
---------------------------------------------------------

I dug in glibc's ChangeLog and I found following change. So, can we consider to change the man too?

---------------------------------------------------------
2009-04-26  Ulrich Drepper  <[email protected]>

Quoted 6 lines

       * sysdeps/ieee754/dbl-64/s_expm1.c: Set errno for overflow.
       * sysdeps/ieee754/flt-32/s_expm1f.c: Likewise.
       * sysdeps/x86_64/fpu/s_expm1l.S: Likewise.

       * sysdeps/ieee754/k_standard.c (__kernel_standard): Pole errors in atanh should set ERANGE.

Thanks for your detailed report. I applied the following change for man-pages-2.37.

Cheers,

Michael

man3/atanh.3 +7 -7
@@ -129,16 +129,16 @@ The variant returning
 also conforms to
 SVr4, 4.3BSD, C89.
 .SH BUGS
-For a pole error,
-.\"
-.\" FIXME . this is as at glibc 2.8; check later if this bug is fixed
+In glibc 2.9 and earlier,
+.\" Bug: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6759
 .\" This can be seen in sysdeps/ieee754/k_standard.c
-.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6759
+when a pole error occurs,
 .I errno
-is set to
-.BR EDOM ;
-POSIX.1 says it should be set to
+as set to
+.BR EDOM
+instead of the POSIX-mandated
 .BR ERANGE .
+Since version 2.10, glibc does the right thing.
 .SH "SEE ALSO"
 .BR acosh (3),
 .BR asinh (3),
Signature · 7 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw
In reply to a message not in the archive
Quoted 29 lines
Quoted 9 lines

---------------------------------------------------------
2009-04-26  Ulrich Drepper  <[email protected]>

       * sysdeps/ieee754/dbl-64/s_expm1.c: Set errno for overflow.
       * sysdeps/ieee754/flt-32/s_expm1f.c: Likewise.
       * sysdeps/x86_64/fpu/s_expm1l.S: Likewise.

       * sysdeps/ieee754/k_standard.c (__kernel_standard): Pole errors in atanh should set ERANGE.

Thanks for your detailed report. I applied the following change for man-pages-2.37.

man3/atanh.3 +3 -5
@@ -129,16 +129,16 @@ The variant returning
 also conforms to
 SVr4, 4.3BSD, C89.
 .SH BUGS
-For a pole error,
-.\"
-.\" FIXME . this is as at glibc 2.8; check later if this bug is fixed
+In glibc 2.9 and earlier,
+.\" Bug: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6759
 .\" This can be seen in sysdeps/ieee754/k_standard.c
-.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6759
+when a pole error occurs,
 .I errno
-is set to

man3/atanh.3 The variant returning · line 144

Quoted 10 lines
man3/atanh.3 +4 -2
-.BR EDOM ;
-POSIX.1 says it should be set to
+as set to
+.BR EDOM
+instead of the POSIX-mandated
 .BR ERANGE .
+Since version 2.10, glibc does the right thing.
 .SH "SEE ALSO"
 .BR acosh (3),
 .BR asinh (3),

Great! This looks goo to me :)

Thanks.

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html