[前][次][番号順一覧][スレッド一覧]

ruby-changes:5917

From: usa <ko1@a...>
Date: Thu, 19 Jun 2008 16:52:00 +0900 (JST)
Subject: [ruby-changes:5917] Ruby:r17425 (trunk): * missing/acosh.c (atanh): should set ERANGE to errno if parameter

usa	2008-06-19 16:51:46 +0900 (Thu, 19 Jun 2008)

  New Revision: 17425

  Modified files:
    trunk/ChangeLog
    trunk/missing/acosh.c

  Log:
    * missing/acosh.c (atanh): should set ERANGE to errno if parameter
      is the boundary case. fixed [ruby-dev:35155]
    


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=17425&r2=17424&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/missing/acosh.c?r1=17425&r2=17424&diff_format=u

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 17424)
+++ ChangeLog	(revision 17425)
@@ -1,3 +1,8 @@
+Thu Jun 19 16:49:36 2008  NAKAMURA Usaku  <usa@r...>
+
+	* missing/acosh.c (atanh): should set ERANGE to errno if parameter
+	  is the boundary case. fixed [ruby-dev:35155]
+
 Thu Jun 19 16:06:01 2008  Hidetoshi NAGAI  <nagai@a...>
 
 	* ext/tk/lib/tkextlib/tile/treeview.rb: cannot configure tags.
Index: missing/acosh.c
===================================================================
--- missing/acosh.c	(revision 17424)
+++ missing/acosh.c	(revision 17425)
@@ -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 @@
     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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]