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
Actions

Also available in: Atom PDF

Like0
Like0Like0