# \[Bug:trunk\] boundary case of acosh() in missing/acosh.c

**URL:** <https://www.ruby-forum.com/t/bug-trunk-boundary-case-of-acosh-in-missing-acosh-c/140775>\
**Category:** Development\
**Created:** [June 18, 2008, 1:08pm UTC](https://www.ruby-forum.com/t/bug-trunk-boundary-case-of-acosh-in-missing-acosh-c/140775 "2008-06-18T13:08:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![U.Nakamura](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/b5ac83/32.png) [@U.Nakamura](https://www.ruby-forum.com/u/U.Nakamura)\
**Post date:** [June 18, 2008, 1:08pm UTC](https://www.ruby-forum.com/t/bug-trunk-boundary-case-of-acosh-in-missing-acosh-c/140775/1 "2008-06-18T13:08:25Z")

</div>

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

e$BK\Ev$K%P%0$J$N$+$I$&$+$h$/$o$+$j$^$;$s$,!"e(Bmissing/acosh.ce$BFb$Ne(B  
atanhe$B$O!“0z?t$,e(B1.0e$B$^$?$Oe(B-1.0e$B$N;~!“e(BInfe$B$^$?$Oe(B-Infe$B$rJV$7!”$+$D!“e(B  
errnoe$B$r%;%C%H$7$^$;$s!#e(B  
C99e$B$de(BSUSv3e$B$r8+$k$H!”$3$N\>l9g$Oe(Berrnoe$B$Ke(BERANGEe$B$,@\_Dj$5$l$k$N$,@5e(B  
e$B$7$$5$$,$7$^$9$7!”$^$?!"e(Btest/ruby/test\_math.rbe$B$Ne(Btest\_atanhe$B$be(B  
e$B$=$&$J$k$3$H$r4|BT$7$F$$$k$h$&$K8+$($^$9!#e(B

e$B$H$$$&$o$1$G!“0J2\<$N%Q%C%A$N$h$&$KJQ99$9$Y$-$J$N$G$O$J$$$+$He(B  
e$B;W$&$N$G$9$,!”$I$&$G$7$g$&$+!#e(B

# Index: missing/acosh.c

— missing/acosh.c (revision 17414)  
+++ missing/acosh.c (working copy)  
@@ -12,6 +12,7 @@  
#include \<errno.h\>  
#include \<float.h\>  
#include \<math.h\>  
+#include “ruby.h”

/\* DBL\_MANT\_DIG must be less than 4 times of bits of int \*/  
#ifndef DBL\_MANT\_DIG  
@@ -79,6 +80,14 @@ atanh(double x)  
if (z \< SMALL\_CRITERIA) return x;  
z = log(z \> 1 ? -1 : (1 + z) / (1 - z)) / 2;  
if (neg) z = -z;

- if (isinf(z))  
+#if defined(ERANGE)
- errno = ERANGE;  
+#elif defined(EDOM)
- errno = EDOM;  
+#else
- ;  
+#endif  
return z;  
}  
#endif

e$B$=$l$G$O!#e(B

---

<div class="post-metadata">

**Author:** ![U.Nakamura](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/b5ac83/32.png) [@U.Nakamura](https://www.ruby-forum.com/u/U.Nakamura)\
**Post date:** [June 19, 2008, 9:36am UTC](https://www.ruby-forum.com/t/bug-trunk-boundary-case-of-acosh-in-missing-acosh-c/140775/2 "2008-06-19T09:36:07Z")

</div>

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:35155] [Bug:trunk] boundary case of acosh() in  
missing/acosh.c”  
on Wed, 18 Jun 2008 20:06:23 +0900, “U.Nakamura”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

|e$BK\Ev$K%P%0$J$N$+$I$&$+$h$/$o$+$j$^$;$s$,!"e(Bmissing/acosh.ce$BFb$Ne(B  
|atanhe$B$O!“0z?t$,e(B1.0e$B$^$?$Oe(B-1.0e$B$N;~!“e(BInfe$B$^$?$Oe(B-Infe$B$rJV$7!”$+$D!“e(B  
|errnoe$B$r%;%C%H$7$^$;$s!#e(B  
|C99e$B$de(BSUSv3e$B$r8+$k$H!”$3$N\>l9g$Oe(Berrnoe$B$Ke(BERANGEe$B$,@\_Dj$5$l$k$N$,@5e(B  
|e$B$7$$5$$,$7$^$9$7!”$^$?!"e(Btest/ruby/test\_math.rbe$B$Ne(Btest\_atanhe$B$be(B  
|e$B$=$&$J$k$3$H$r4|BT$7$F$$$k$h$&$K8+$($^$9!#e(B  
|  
|e$B$H$$$&$o$1$G!“0J2\<$N%Q%C%A$N$h$&$KJQ99$9$Y$-$J$N$G$O$J$$$+$He(B  
|e$B;W$&$N$G$9$,!”$I$&$G$7$g$&$+!#e(B

e$B%3%\_%C%H$7$F$/$@$5$$!#H?BP$,$"$l$P%j%P!\<%H$9$k$H$$$&$3$H$G!#e(B

---

<div class="post-metadata">

**Author:** ![U.Nakamura](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/b5ac83/32.png) [@U.Nakamura](https://www.ruby-forum.com/u/U.Nakamura)\
**Post date:** [June 19, 2008, 9:57am UTC](https://www.ruby-forum.com/t/bug-trunk-boundary-case-of-acosh-in-missing-acosh-c/140775/3 "2008-06-19T09:57:54Z")

</div>

e$B%A%1%C%He(B #189 e$B$,99?7$5$l$^$7$?!#e(B (by Usaku NAKAMURA)

e$B%9%F!\<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B  
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

## Applied in changeset r17425.

[http://redmine.ruby-lang.org/issues/show/189](http://redmine.ruby-lang.org/issues/show/189)
