Project

General

Profile

Actions

Bug #17945

closed

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

Added by bjfish (Brandon Fish) about 2 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
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) about 2 months 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) about 2 months ago

  • Status changed from Open to Closed
Actions

Also available in: Atom PDF