struct

Number

Inherits Steppable < Comparable < Value < Object

The top-level number type.

Instance methods

<=>(other) : Int32 | Nil

The comparison operator.

Returns:

  • -1 if self is less than other
  • 0 if self is equal to other
  • 1 if self is greater than other
  • nil if self is NaN or other is NaN, because NaN values are not comparable
Source