Project

General

Profile

Actions

Bug #17945

closed

Date::Infinity comparison <=> with Float::INFINITY not symmetric

Added by bjfish (Brandon Fish) almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
3.0.0, 2.7.3
[ruby-core:104231]

Description

Example

require 'date'
p Float::INFINITY <=> Date::Infinity.new
p Date::Infinity.new <=> Float::INFINITY

Expected Result
I expected the comparison to have the same result when the order of values is switched.

0
0

Actual Result

0
1

Updated by jeremyevans0 (Jeremy Evans) almost 3 years ago

I've submitted a pull request upstream to fix this: https://github.com/ruby/date/pull/34

Actions #2

Updated by jeremyevans0 (Jeremy Evans) almost 3 years ago

  • Status changed from Open to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0