summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-11-27 10:00:35 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-11-27 10:00:35 +0000
commit186c8b592a8b5badfd42ff7295c5edb44ef1abdd (patch)
tree922c6ba9baaf7b140efadfb387c0a0780e544eb6 /marshal.c
parent09a4937b2fcf883fa57af1dfa5d12f605f812970 (diff)
* marshal.c (w_float): must distinguish -0.0 from 0.0.
* gc.c (gc_mark_all): tweak mark order for little bit better scan. * gc.c (rb_gc_mark): ditto. * gc.c (rb_gc): ditto. * enum.c (sort_by_i): slight performance boost. * gc.c (gc_mark_rest): should call gc_mark_children(), not gc_mark(). * gc.c (rb_gc_mark): may cause infinite looop. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/marshal.c b/marshal.c
index 8448f99..93005e9 100644
--- a/marshal.c
+++ b/marshal.c
@@ -194,6 +194,10 @@ w_float(d, arg)
else if (isnan(d)) {
strcpy(buf, "nan");
}
+ else if (d == 0.0) {
+ if (1.0/d < 0) strcpy(buf, "-0");
+ else strcpy(buf, "0");
+ }
else {
/* xxx: should not use system's sprintf(3) */
sprintf(buf, "%.16g", d);