- - - 目次

Fixnum

マシンのポインタのサイズに収まる長さの固定長整数.ほとんどの マシンでは31ビット幅です.演算の結果がFixnumの 範囲を越えた時には自動的に Bignumに拡張されます.

スーパークラス:

Integer

メソッド:

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

算術演算子.

~ self
self | other
self & other
self ^ other

ビット演算子.

self << bits
self >> bits

シフト演算子.

id2name

(シンボルの)整数に対応する文字列を返します.もし整数に対応す るシンボルが存在しない時にはnilを返します.

remainder(other)

selfotherで割った余りを返します. 整数に負の数を含む時,%と値が異なります.

 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

- - - 目次

matz@netlab.co.jp