summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2021-06-15 10:39:42 -0700
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-07-11 20:28:21 +0900
commit8065670cfbfcf89249c2de12a513b5c7308c9aeb (patch)
treea8e9044dd8879f9ec2bf91c349fac25a9a5a0e97 /ext
parent49ba7cd2598e047aba37c204c143ce6ee2364e8c (diff)
[ruby/date] Fix comparison with Float::INFINITY
Fixes [Bug #17945] https://github.com/ruby/date/commit/953d907238
Diffstat (limited to 'ext')
-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