Class: Integer

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

Constant Summary

MAX =
`Math.pow(2, 30) - 1`
MIN =
`-Math.pow(2, 30)`

Class Method Summary collapse

Methods inherited from Numeric

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

Methods included from Comparable

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

Class Method Details

.===(other) ⇒ Object



898
899
900
901
902
903
904
905
906
# File 'opal/opal/corelib/number.rb', line 898

def ===(other)
  %x{
    if (!other.$$is_number) {
      return false;
    }

    return (other % 1) === 0;
  }
end

.allocateObject

Raises:



892
893
894
# File 'opal/opal/corelib/number.rb', line 892

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