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:
parent
8fca66d7eb
commit
72be91b5c0
1 changed files with 8 additions and 8 deletions
|
@ -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
|
||||
vn = RRATIONAL(vs)->num;
|
||||
vd = RRATIONAL(vs)->den;
|
||||
#endif
|
||||
vn = RRATIONAL(vs)->num;
|
||||
vd = RRATIONAL(vs)->den;
|
||||
|
||||
if (FIXNUM_P(vn) && FIXNUM_P(vd) && (FIX2LONG(vd) == 1))
|
||||
n = FIX2LONG(vn);
|
||||
|
|
Loading…
Reference in a new issue