Class: Date::Infinity
Do not use. This class is for internal use only.
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Numeric
|
|
Instance Chain:
self,
Comparable,
Numeric
|
|
Inherits: |
Numeric
|
Defined in: | ext/date/lib/date.rb |
Class Method Summary
- .new(d = 1) ⇒ Infinity constructor
Instance Method Summary
Constructor Details
.new(d = 1) ⇒ Infinity
Instance Method Details
#+@
[ GitHub ]#-@
[ GitHub ]#<=>(other)
[ GitHub ]#abs
[ GitHub ]# File 'ext/date/lib/date.rb', line 28
def abs() self.class.new end
#coerce(other)
[ GitHub ]#d (protected)
[ GitHub ]# File 'ext/date/lib/date.rb', line 19
def d() @d end
#finite? ⇒ Boolean
# File 'ext/date/lib/date.rb', line 24
def finite?() false end
#infinite? ⇒ Boolean
# File 'ext/date/lib/date.rb', line 25
def infinite?() d.nonzero? end
#nan? ⇒ Boolean
#to_f
[ GitHub ]# File 'ext/date/lib/date.rb', line 55
def to_f return 0 if @d == 0 if @d > 0 Float::INFINITY else -Float::INFINITY end end
#zero? ⇒ Boolean
# File 'ext/date/lib/date.rb', line 23
def zero?() false end