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 24
def abs() self.class.new end
#coerce(other)
[ GitHub ]#d (protected)
[ GitHub ]# File 'ext/date/lib/date.rb', line 15
def d() @d end
#finite? ⇒ Boolean
# File 'ext/date/lib/date.rb', line 20
def finite?() false end
#infinite? ⇒ Boolean
# File 'ext/date/lib/date.rb', line 21
def infinite?() d.nonzero? end
#nan? ⇒ Boolean
#to_f
[ GitHub ]# File 'ext/date/lib/date.rb', line 51
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 19
def zero?() false end