25件ヒット
[1-25件を表示]
(0.034秒)
検索結果
-
Float
# divmod(other) -> [Numeric] (27133.0) -
self を other で割った商 q と余り r を、 [q, r] という 2 要素の配列にして返します。 商 q は常に整数ですが、余り r は整数であるとは限りません。
...ます。
@param other 自身を割る数を指定します。
//emlist[例][ruby]{
11.divmod(3) # => [3, 2]
(11.5).divmod(3.5) # => [3, 1.0]
11.divmod(-3) # => [-4, -1]
11.divmod(3.5) # => [3, 0.5]
(-11).divmod(3.5) # => [-4, 3.0]
//}
@see Numeric#div, Numeric#modulo... -
Bignum
# remainder(other) -> Fixnum | Bignum | Float (109.0) -
self を other で割った余り r を返します。
...self を other で割った余り r を返します。
r の符号は self と同じになります。
@param other self を割る数。
@see Bignum#divmod, Bignum#modulo, Numeric#modulo... -
Numeric (90.0)
-
数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。
...数値を表す抽象クラスです。Integer や Float などの数値クラス
は Numeric のサブクラスとして実装されています。
演算や比較を行うメソッド(+, -, *, /, <=>)は Numeric のサブクラスで定義されま
す。Numeric で定義されているメソッ......ださい。
=> ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
Numeric Integer Fixnum Bignum Float Rational Complex
-------------------------------------------------------------------------------------------......< | - - o o o - -
Numeric Integer Fixnum Bignum Float Rational Complex
-------------------------------------------------------------------------------------------......を参照してください。
=> ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin15]
Numeric Integer Float Rational Complex
--------------------------------------------------------------------------------
% | o......o o
< | - o o - -
Numeric Integer Float Rational Complex
--------------------------------------------------------------------------------
<< | -...