mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* numeric.c (dbl2ival): Fix Float#divmod and #round for 32 bit platform
part 1 of [bug #5276] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3dc28710c9
commit
80f54e6810
2 changed files with 6 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Tue Sep 6 06:44:57 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
||||||
|
|
||||||
|
* numeric.c (dbl2ival): Fix Float#divmod and #round for 32 bit
|
||||||
|
platform. part 1 of [bug #5276]
|
||||||
|
|
||||||
Tue Sep 6 06:44:25 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
Tue Sep 6 06:44:25 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
||||||
|
|
||||||
* numeric.c (flo_round): Fix criteria for 32 bits platform
|
* numeric.c (flo_round): Fix criteria for 32 bits platform
|
||||||
|
|
|
@ -873,8 +873,8 @@ flo_mod(VALUE x, VALUE y)
|
||||||
static VALUE
|
static VALUE
|
||||||
dbl2ival(double d)
|
dbl2ival(double d)
|
||||||
{
|
{
|
||||||
|
d = round(d);
|
||||||
if (FIXABLE(d)) {
|
if (FIXABLE(d)) {
|
||||||
d = round(d);
|
|
||||||
return LONG2FIX((long)d);
|
return LONG2FIX((long)d);
|
||||||
}
|
}
|
||||||
return rb_dbl2big(d);
|
return rb_dbl2big(d);
|
||||||
|
|
Loading…
Add table
Reference in a new issue