るりまサーチ

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

別のキーワード

  1. _builtin %
  2. bigdecimal %
  3. range %
  4. bn %
  5. float %

ライブラリ

クラス

キーワード

検索結果

<< 1 2 > >>

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

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

...ます。
modulo
はメソッド % の呼び出しとして定義されています。

@
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 (18162.0)

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

...ます。
modulo
はメソッド % の呼び出しとして定義されています。

@
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...

Integer#%(other) -> Numeric (18138.0)

算術演算子。剰余を計算します。

...算術演算子。剰余を計算します。

//emlist[][ruby]{
13 % 4 # => 1
13 % -4 # => -3
-13 % 4 # => 3
-13 % -4 # => -1
//}

@
param other 二項演算の右側の引数(対象)
@
return 計算結果...

Integer#modulo(other) -> Numeric (18138.0)

算術演算子。剰余を計算します。

...算術演算子。剰余を計算します。

//emlist[][ruby]{
13 % 4 # => 1
13 % -4 # => -3
-13 % 4 # => 3
-13 % -4 # => -1
//}

@
param other 二項演算の右側の引数(対象)
@
return 計算結果...

BigDecimal#%(n) -> BigDecimal (18132.0)

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

...self を n で割った余りを返します。

@
param n self を割る数を指定します。

//emlist[][ruby]{
require 'bigdecimal'
x = BigDecimal((2**100).to_s)
( x % 3).to_i # => 1
(-x % 3).to_i # => 2
( x % -3).to_i # => -2
(-x % -3).to_i # => -1
//}

戻り値は n と同じ符号にな...
...ります。これは BigDecimal#remainder とは
異なる点に注意してください。詳細は Numeric#%
Numeric#remainder を参照して下さい。...

絞り込み条件を変える

BigDecimal#modulo(n) -> BigDecimal (18132.0)

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

...self を n で割った余りを返します。

@
param n self を割る数を指定します。

//emlist[][ruby]{
require 'bigdecimal'
x = BigDecimal((2**100).to_s)
( x % 3).to_i # => 1
(-x % 3).to_i # => 2
( x % -3).to_i # => -2
(-x % -3).to_i # => -1
//}

戻り値は n と同じ符号にな...
...ります。これは BigDecimal#remainder とは
異なる点に注意してください。詳細は Numeric#%
Numeric#remainder を参照して下さい。...

Float#%(other) -> Float (18120.0)

算術演算子。剰余を計算します。

...算術演算子。剰余を計算します。

@
param other 二項演算の右側の引数(対象)

//emlist[例][ruby]{
# 剰余
3.0 % 1.2 # => 0.6000000000000001
3.0 % 0.0 # ZeroDivisionError
//}...

Float#modulo(other) -> Float (18120.0)

算術演算子。剰余を計算します。

...算術演算子。剰余を計算します。

@
param other 二項演算の右側の引数(対象)

//emlist[例][ruby]{
# 剰余
3.0 % 1.2 # => 0.6000000000000001
3.0 % 0.0 # ZeroDivisionError
//}...

Bignum#%(other) -> Fixnum | Bignum | Float (18114.0)

算術演算子。剰余を計算します。

...算術演算子。剰余を計算します。

@
param other 二項演算の右側の引数(対象)
@
return 計算結果...

Bignum#modulo(other) -> Fixnum | Bignum | Float (18114.0)

算術演算子。剰余を計算します。

...算術演算子。剰余を計算します。

@
param other 二項演算の右側の引数(対象)
@
return 計算結果...

絞り込み条件を変える

<< 1 2 > >>