Class: RubyJS.Fixnum

Defined in: lib/corelib/fixnum.coffee
Inherits: RubyJS.Integer

Class Method Summary

Instance Method Summary

Inherited Method Summary

Methods inherited from RubyJS.Integer

.new, .isInteger, #chr, #denominator, #downto, #even, #gcd, #gcdlcm, #lcm, #numerator, #odd, #ord, #next, #pred, #round, #times, #to_i, #upto, #toString

Methods inherited from RubyJS.Numeric

.isNumeric, .try_convert, .new, .typecast, '-instance'>#'<=>', #abs, #abs2, #ceil, #coerce, #div, #divmod, #eql, #inspect, #fdiv, #floor, #magnitude, #modulo, #nonzero, #quo, #rect, #remainder, #round, #step, #truncate, #uminus, #zero

Methods inherited from RubyJS.Object

.include, .__add_default_aliases__, #send, #respond_to, #to_enum, #tap

Class Method Details

+ (void) new(val)

+ (void) try_convert(obj)

+ (void) __cache_fixnums__(from = -1, to = 256)

Fixnums are unchangeable. Cache them for later use.

Constructor Details

- (void) constructor(__native__)

Instance Method Details

- (void) is_fixnum()

- (void) to_native()

- (void) dup()

- (void) '=='(other)

'-instance'> - (void) '<=>'(other)

- (void) '+'(other)

- (void) '-'(other)

- (void) '/'(other)

- (void) '*'(other)

- (void) '**'(other)

- (void) '%'(other)

- (void) fdiv(other)

Returns the floating point result of dividing fix by numeric.

Examples:

  R(654321).fdiv(13731)      #=> 47.6528293642124
  R(654321).fdiv(13731.24)   #=> 47.6519964693647

- (void) object_id()

- (void) to_f()

Converts fix to a Float.

- (void) to_s(base = 10)

Returns a string containing the representation of fix radix base (between 2 and 36).

Examples:

  R(12345).to_s()     #=> "12345"
  R(12345).to_s(2)    #=> "11000000111001"
  R(12345).to_s(8)    #=> "30071"
  R(12345).to_s(10)   #=> "12345"
  R(12345).to_s(16)   #=> "3039"
  R(12345).to_s(36)   #=> "9ix"