mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* numeric.c (flodivmod): must through the same pass if HAVE_FMOD or not.
this is a bugfix of r35013. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
005953a17b
commit
cc3d03b196
2 changed files with 9 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Wed Mar 14 17:55:29 2012 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* numeric.c (flodivmod): must through the same pass if HAVE_FMOD or not.
|
||||||
|
this is a bugfix of r35013.
|
||||||
|
|
||||||
Wed Mar 14 16:41:55 2012 NAKAMURA Usaku <usa@ruby-lang.org>
|
Wed Mar 14 16:41:55 2012 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* test/test_tmpdir.rb (TestTmpdir#test_world_writable): skip on Windows.
|
* test/test_tmpdir.rb (TestTmpdir#test_world_writable): skip on Windows.
|
||||||
|
|
|
@ -814,18 +814,18 @@ flodivmod(double x, double y, double *divp, double *modp)
|
||||||
double div, mod;
|
double div, mod;
|
||||||
|
|
||||||
if (y == 0.0) rb_num_zerodiv();
|
if (y == 0.0) rb_num_zerodiv();
|
||||||
#ifdef HAVE_FMOD
|
|
||||||
mod = fmod(x, y);
|
|
||||||
#else
|
|
||||||
if((x == 0.0) || (isinf(y) && !isinf(x)))
|
if((x == 0.0) || (isinf(y) && !isinf(x)))
|
||||||
mod = x;
|
mod = x;
|
||||||
else {
|
else {
|
||||||
|
#ifdef HAVE_FMOD
|
||||||
|
mod = fmod(x, y);
|
||||||
|
#else
|
||||||
double z;
|
double z;
|
||||||
|
|
||||||
modf(x/y, &z);
|
modf(x/y, &z);
|
||||||
mod = x - z * y;
|
mod = x - z * y;
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
if (isinf(x) && !isinf(y) && !isnan(y))
|
if (isinf(x) && !isinf(y) && !isnan(y))
|
||||||
div = x;
|
div = x;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue