Class: Float

Inherits:
Numeric show all
Defined in:
opal/opal/corelib/number.rb,
opal/opal/corelib/marshal/write_buffer.rb

Constant Summary

INFINITY =
`Infinity`
MAX =
`Number.MAX_VALUE`
MIN =
`Number.MIN_VALUE`
NAN =
`NaN`
DIG =
15
MANT_DIG =
53
RADIX =
2
EPSILON =
`Number.EPSILON || 2.2204460492503130808472633361816E-16`

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Numeric

#%, #+@, #-@, #<=>, #__coerced__, #abs, #abs2, #angle, #ceil, #clone, #coerce, #conj, #denominator, #div, #divmod, #dup, #fdiv, #finite?, #floor, #i, #imag, #infinite?, #integer?, #negative?, #nonzero?, #numerator, #polar, #positive?, #quo, #real, #real?, #rect, #round, #to_c, #to_int, #truncate, #zero?

Methods included from Comparable

#<, #<=, #==, #>, #>=, #between?, #clamp

Class Method Details

.===(other) ⇒ Object



1057
1058
1059
# File 'opal/opal/corelib/number.rb', line 1057

def ===(other)
  `!!other.$$is_number`
end

.allocateObject

Raises:



1051
1052
1053
# File 'opal/opal/corelib/number.rb', line 1051

def allocate
  raise TypeError, "allocator undefined for #{name}"
end

Instance Method Details

#__marshal__(buffer) ⇒ Object



30
31
32
33
34
# File 'opal/opal/corelib/marshal/write_buffer.rb', line 30

def __marshal__(buffer)
  buffer.save_link(self)
  buffer.append('f')
  buffer.write_float(self)
end