summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-01 03:12:21 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-01 03:12:21 +0000
commite4b53b22228d935847b72e8f9ab0f49a15b54215 (patch)
treeae6cd78921bf626d54145b5485474bf59c3dceb4 /time.c
parent005f12582975d8382851b740690f97dba35aaa2a (diff)
2000-02-01
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r--time.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/time.c b/time.c
index 65e479a..5ea0f96 100644
--- a/time.c
+++ b/time.c
@@ -400,14 +400,12 @@ time_cmp(time1, time2)
{
double t;
- if (tobj1->tv.tv_sec == (time_t)RFLOAT(time2)->value)
- return INT2FIX(0);
t = (double)tobj1->tv.tv_sec + (double)tobj1->tv.tv_usec*1e-6;
- if (tobj1->tv.tv_sec == (time_t)RFLOAT(time2)->value)
- return INT2FIX(0);
- if (tobj1->tv.tv_sec > (time_t)RFLOAT(time2)->value)
+ if (t > RFLOAT(time2)->value)
return INT2FIX(1);
- return FIX2INT(-1);
+ if (t < RFLOAT(time2)->value)
+ return INT2FIX(-1);
+ return INT2FIX(0);
}
}