summaryrefslogtreecommitdiff
path: root/ext/date/lib/date.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/date/lib/date.rb')
-rw-r--r--ext/date/lib/date.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/date/lib/date.rb b/ext/date/lib/date.rb
index 65c34ace49..4901219503 100644
--- a/ext/date/lib/date.rb
+++ b/ext/date/lib/date.rb
@@ -30,6 +30,8 @@ class Date
def <=>(other)
case other
when Infinity; return d <=> other.d
+ when Float::INFINITY; return d <=> 1
+ when -Float::INFINITY; return d <=> -1
when Numeric; return d
else
begin