# frozen_string_literal: true
# date.rb: Written by Tadayoshi Funaba 1998-2011
class Infinity < Numeric # :nodoc:
def initialize(d=1) @d = d <=> 0 end
def infinite?() d.nonzero? end
def abs() self.class.new end
def -@() self.class.new(-d) end
def +@() self.class.new(+d) end
when Infinity; return d <=> other.d
l, r = other.coerce(self)
when Numeric; return -d, d