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