Class: Axiom::Types::NegativeInfinity

Inherits:
Infinity
  • Object
show all
Defined in:
lib/axiom/types/support/infinity.rb

Overview

Represent a negative infinite number

Instance Method Summary collapse

Methods inherited from Infinity

#coerce, #succ

Methods included from Options

#accept_options

Instance Method Details

#<=>(_other) ⇒ 0, -1

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Test the number against negative infinity

Parameters:

Returns:

  • (0)

    returned if the other object is negative infinity

  • (-1)

    returned if the other object is not negative infinity



87
88
89
90
# File 'lib/axiom/types/support/infinity.rb', line 87

def <=>(_other)
  comparison = super
  -comparison if comparison
end