[Python-checkins] r60429 - python/branches/trunk-math/Python/pymath.c

mark.dickinson python-checkins at python.org
Tue Jan 29 23:39:13 CET 2008


Author: mark.dickinson
Date: Tue Jan 29 23:39:13 2008
New Revision: 60429

Modified:
   python/branches/trunk-math/Python/pymath.c
Log:
Remove the ((huge+x) > 1.0) check from asinh; it's unnecessary (it 
serves only to raise the inexact floating-point exception, which Python 
doesn't care about), and the value huge is a potential 
platform-dependency.



Modified: python/branches/trunk-math/Python/pymath.c
==============================================================================
--- python/branches/trunk-math/Python/pymath.c	(original)
+++ python/branches/trunk-math/Python/pymath.c	Tue Jan 29 23:39:13 2008
@@ -88,7 +88,6 @@
  */
 
 static const double ln2 = 6.93147180559945286227E-01;
-static const double huge = 1E+300;
 static const double two_pow_m28 = 3.7252902984619141E-09; /* 2**-28 */
 static const double two_pow_p28 = 268435456.0; /* 2**28 */
 static const double zero = 0.0;
@@ -115,8 +114,7 @@
 		return x+x;
 	}
 	if (absx < two_pow_m28) {	/* |x| < 2**-28 */
-		if ((huge + x) > 1.0)
-			return x;	/* return x inexact except 0 */
+		return x;	/* return x inexact except 0 */
 	} 
 	if (absx > two_pow_p28) {	/* |x| > 2**28 */
 		w = log(absx)+ln2;
@@ -231,4 +229,4 @@
 	}
 	return copysign(t, x);
 }
-#endif /* HAVE_ATANH */
\ No newline at end of file
+#endif /* HAVE_ATANH */


More information about the Python-checkins mailing list