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

reedited previous commit

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tadf 2011-06-30 18:49:04 +00:00
parent 8fca66d7eb
commit 72be91b5c0

View file

@ -2300,17 +2300,17 @@ offset_to_sec(VALUE vof, int *rof)
#ifdef CANONICALIZATION_FOR_MATHN
if (!k_rational_p(vs)) {
vn = vs;
vd = INT2FIX(1);
if (!FIXNUM_P(vs))
return 0;
n = FIX2LONG(vs);
if (n < -DAY_IN_SECONDS || n > DAY_IN_SECONDS)
return 0;
*rof = (int)n;
return 1;
}
else {
vn = RRATIONAL(vs)->num;
vd = RRATIONAL(vs)->den;
}
#else
#endif
vn = RRATIONAL(vs)->num;
vd = RRATIONAL(vs)->den;
#endif
if (FIXNUM_P(vn) && FIXNUM_P(vd) && (FIX2LONG(vd) == 1))
n = FIX2LONG(vn);