[Mono-bugs] [Bug 75228][Nor] Changed - double.Parse
("6363883797383966.2933E-726") gives NaN not 0
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Thu Sep 8 06:40:13 EDT 2005
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by atsushi at ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=75228
--- shadow/75228 2005-06-24 17:23:15.000000000 -0400
+++ shadow/75228.tmp.11777 2005-09-08 06:40:12.000000000 -0400
@@ -58,6 +58,45 @@
NaN
admin at cygwin-mono ~
$ ./x.exe
0
+
+------- Additional Comments From atsushi at ximian.com 2005-09-08 06:40 -------
+bsd_strtod() seems to be broken. To test it:
+
+1. Save teststrtod.c below.
+2. Copy strtod.c and strtod.h from mono/mono/utils/ to current directory.
+3. gcc teststrtod.c strtod.c strtod.h
+4. run.
+
+---- teststrtod.c ----
+#include <stdio.h>
+#include <stdlib.h>
+
+int main ()
+{
+ const char* str = "6363883797383966.2933E-726";
+ char* estr = NULL;
+ double d = bsd_strtod (str, &estr);
+ printf ("%f, %d\n", d, estr - str);
+}
+---- end ----
+
+--- /home/atsushi/svn/mono/mono/utils/strtod.c 2005-08-29
+04:23:16.913062400 +0
+900
++++ strtod.c 2005-09-08 19:03:18.868217600 +0900
+@@ -11,7 +11,8 @@
+ *
+ * Taken from the FreeBSD distribution.
+ */
+-#include <glib.h>
++typedef unsigned long guint32;
++typedef long gint32;
+
+ #include "strtod.h"
+
+Under Windows it results in the same infinite loop. It would be nice
+if someone attach the results from other environments.
+
More information about the mono-bugs
mailing list