[4suite-checkins] [XML1_0-maint] In 4Suite/Ft/Xml/Xslt/Exslt, files Math_.py

Mike Brown mbrown at 4suite.org
Wed Dec 13 23:58:14 MST 2006


Branch: XML1_0-maint

Modified Files:
    Math_.py

Log Message:
comment cleanup from previous commit

ViewCVS diff:
  http://cvs.4suite.org/viewcvs/4Suite/Ft/Xml/Xslt/Exslt/Math_.py.diff?r1=1.4.4.1&r2=1.4.4.2
ViewCVS view:
  http://cvs.4suite.org/viewcvs/4Suite/Ft/Xml/Xslt/Exslt/Math_.py?rev=1.4.4.2&content-type=text/vnd.viewcvs-markup

Index: Math_.py
===================================================================
RCS file: /var/local/cvsroot/4Suite/Ft/Xml/Xslt/Exslt/Math_.py,v
retrieving revision 1.4.4.1
retrieving revision 1.4.4.2
diff -U2 -r1.4.4.1 -r1.4.4.2
--- Math_.py	14 Dec 2006 06:48:49 -0000	1.4.4.1
+++ Math_.py	14 Dec 2006 06:58:14 -0000	1.4.4.2
@@ -213,8 +213,12 @@
     The math:sqrt function returns the square root of a number.
     """
-    # posix: math.sqrt() returns nan for negative or nan arg
-    # windows: math.sqrt() produces a ValueError for same args
-    # For consistency we'll return nan for nan arg.
+    # The platform C library determines what math.sqrt() returns.
+    # On some platforms, especially prior to Python 2.4,
+    # nan may be returned for a negative or nan argument.
+    # On other platforms, and especially since Python 2.4,
+    # a ValueError is raised.
+    #
     # EXSLT requires that we return zero for negative arg.
+    # The result for a nan arg is undefined, but we'll return nan.
     n = Conversions.NumberValue(num)
     if number.isnan(n):


More information about the 4suite-checkins mailing list