mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* marshal.c (w_float): strip ".0" from end for rubyspec.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ccbdebf5a9
commit
4eb19660e9
2 changed files with 8 additions and 1 deletions
|
@ -369,7 +369,10 @@ w_float(double d, struct dump_arg *arg)
|
|||
else w_cstr("0", arg);
|
||||
}
|
||||
else {
|
||||
w_bytes(buf, ruby_dbl2cstr(d, buf, (int)sizeof(buf)), arg);
|
||||
int len = ruby_dbl2cstr(d, buf, (int)sizeof(buf));
|
||||
if (len > 2 && buf[len - 1] == '0' && buf[len - 2] == '.')
|
||||
len -= 2;
|
||||
w_bytes(buf, len, arg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue