るりまサーチ

最速Rubyリファレンスマニュアル検索!
99件ヒット [1-99件を表示] (0.068秒)
トップページ > クエリ:@[x] > クエリ:remainder[x]

別のキーワード

  1. _builtin remainder
  2. bigdecimal remainder
  3. integer remainder
  4. numeric remainder
  5. remainder

ライブラリ

クラス

キーワード

検索結果

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

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

...す。

@
param other 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 Inte...

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

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

...します。

@
param 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#divm...

BigDecimal#remainder(n) -> BigDecimal (18137.0)

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

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

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

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

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

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

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

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

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

@
param other self を割る数。

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

ruby 1.6 feature (72.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...>))

Object.new.instance_eval {
p remove_instance_variable :@foo
}
=> ruby 1.6.7 (2002-03-01) [i586-linux]
nil

=> -:2:in `remove_instance_variable': instance variable @foo not defined (NameError)
ruby 1.6.7 (2002-04-10) [i586-linux]

:...
...わることはなくなりました。((<ruby-dev:17876>))

class Foo
FOO = 1
@
@foo = 1
end

FOO = 2
@
@foo = 2

Foo.module_eval { p FOO, @@foo }

=> ruby 1.6.7 (2002-03-01) [i586-linux]
1
1

=> ruby 1....
...09-19) [i586-linux]
1
=> ruby 1.6.5 (2001-11-01) [i586-linux]
1

: Numeric#remainder

((<ruby-bugs-ja:PR#110>))

p( 3.remainder(-3))
p(-3.remainder(3))

=> ruby 1.6.5 (2001-09-19) [i586-linux]
3
-3
=> ruby 1.6.5 (2...

絞り込み条件を変える

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

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 (18.0)

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 を参照して下さい。...

Numeric#%(other) -> Numeric (18.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 (18.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...