るりまサーチ

最速Rubyリファレンスマニュアル検索!
47件ヒット [1-47件を表示] (0.058秒)

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

クラス

キーワード

検索結果

Integer#remainder(other) -> Numeric (18288.0)

self を other で割った余り r を返します。

...ther self を割る数。

//emlist[][ruby]{
5.remainder(3) # => 2
-
5.remainder(3) # => -2
5.remainder(-3) # => 2
-
5.remainder(-3) # => -2

-
1234567890987654321.remainder(13731) # => -6966
-
1234567890987654321.remainder(13731.24) # => -9906.22531493148
//}

@see Integer#divmod, Inte...

Numeric#remainder(other) -> Numeric (18258.0)

self を other で割った余り r を返します。

...します。

ここで、商 q と余り r は、

* self == other * q + r


* self > 0 のとき 0 <= r < |other|
* self < 0 のとき -|other| < r <= 0
* q は整数

をみたす数です。r の符号は self と同じになります。
商 q を直接返すメソッドはあり...
...other 自身を割る数を指定します。

//emlist[例][ruby]{
p 13.remainder(4) #=> 1
p (11.5).remainder(3.5) #=> 1.0
p 13.remainder(-4) #=> 1
p (-13).remainder(4) #=> -1
p (-13).remainder(-4) #=> -1
p (-11).remainder(3.5) #=> -0.5
//}

@see Numeric#divmod, Numeric#modulo...

Bignum#remainder(other) -> Fixnum | Bignum | Float (18204.0)

self を other で割った余り r を返します。

self を other で割った余り r を返します。

r の符号は self と同じになります。

@param other self を割る数。

@see Bignum#divmod, Bignum#modulo, Numeric#modulo

Numeric#%(other) -> Numeric (121.0)

self を other で割った余り r を返します。

...す。

@param other 自身を割る数を指定します。

//emlist[例][ruby]{
p 13.modulo(4) #=> 1
p (11.5).modulo(3.5) #=> 1.0
p 13.modulo(-4) #=> -3
p (-13).modulo(4) #=> 3
p (-13).modulo(-4) #=> -1
p (-11).modulo(3.5) #=> 3.0
//}

@see Numeric#divmod, Numeric#remainder...

Numeric#modulo(other) -> Numeric (121.0)

self を other で割った余り r を返します。

...す。

@param other 自身を割る数を指定します。

//emlist[例][ruby]{
p 13.modulo(4) #=> 1
p (11.5).modulo(3.5) #=> 1.0
p 13.modulo(-4) #=> -3
p (-13).modulo(4) #=> 3
p (-13).modulo(-4) #=> -1
p (-11).modulo(3.5) #=> 3.0
//}

@see Numeric#divmod, Numeric#remainder...

絞り込み条件を変える