1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* numeric.c (flo_to_s): change format specifier to "%.15g" to

avoid unnecessary 9s (e.g. 99.59999999999999). (ruby-bugs-ja PR#406)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2003-03-20 07:15:29 +00:00
parent bf12ea0deb
commit 0b39cf78fe
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Thu Mar 20 16:12:53 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* numeric.c (flo_to_s): change format specifier to "%.15g" to
avoid unnecessary 9s (e.g. 99.59999999999999). (ruby-bugs-ja PR#406)
Thu Mar 20 16:03:18 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* parse.y (stmt, primary): get rid of SEGV at empty or invalid

View file

@ -273,7 +273,7 @@ flo_to_s(flt)
VALUE flt;
{
char buf[24];
char *fmt = "%.16g";
char *fmt = "%.15g";
double value = RFLOAT(flt)->value;
double avalue, d1, d2;