Website hosting service by Active-Venture.com
 

 Back to Index

prev - up - next - index

Integer

The abstract class for integers, which has two subclasses Fixnum and Bignum. In Ruby, both kinds of integers are mixable, and converted automatically according to the value. Integers can be treated as infinite bit strings for bit operations.

SuperClass:

Numeric

Included Modules:

Precision

Class Methods:

induced_from(num)

Converts num into Integer.

Methods:

self[nth]

Returns 1 if nth bit of the integer set, otherwise 0.

chr

Returns the string contains a character represented by that number in the character set. For example, 65.chr returns the string "A".

The number must be within 0 to 255.

downto(min) {...}

Iterates from self to min, decrementing by 1.

integer?

Returns true.

size

Returns the approximate size of the integer in byte.

step(max, step) {...}

Iterates from self to max, adding step each time.

succ

Returns the ``next'' value of the integer.

times {...}

Iterates self times. Self may be rounded into integer.

to_i

Returns the receiver, since Integers do not need any conversion.

upto(max) {...}

Iterates from self to max, incrementing by 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/