Website hosting service by Active-Venture.com
 

 Back to Index

prev - up - next - index

Fixnum

The class for the fixed range integers fit in the machine's pointer, which is 31 bits length on most machines. Fixnums are immediate values. If the result of the operations on fixnums exceed the range, it will automatically expanded to bignums.

SuperClass:

Integer

Methods:

self + other
self - other
self * other
self / other
self % other
self ** other

Arithmetic operations.

~ self
self | other
self & other
self ^ other
self << bits
self >> bits

Bit operations

id2name

Returns a corresponding strings to the number. If there is no corresponding symbol to the integer, it returns nil.

remainder(other)

Returns remainder of the numbers. In case either number is negative, the evaluated value differs from that of the operator %.

  13 %  4  =>  1
  13 % -4  => -3
 -13 %  4  =>  3
 -13 % -4  => -1

  13.remainder(4)    =>  1
  13.remainder(-4)   =>  1
(-13).remainder(4)   => -1
(-13).remainder(-4)  => -1

prev - up - next - index

matz@netlab.co.jp

 

  

 

 

2002-2004 Active-Venture.com Website Hosting Service

 
Buy domain name at only $5.95/yr with comprehensive domain hosting services. Domain registration and domain search service from $5.95 Cheap domain name registration and domain transfer service
 

Disclaimer: This documentation is provided only for the benefits of our website hosting customers.
For authoritative source of the documentation, please refer to http://www.ruby-doc.org/docs/