るりまサーチ

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

別のキーワード

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

ライブラリ

キーワード

検索結果

Float#*(other) -> Float (18207.0)

算術演算子。積を計算します。

...算術演算子。積を計算します。

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

//emlist[例][ruby]{
# 積
2.4 * 3 # => 7.2
//}...

Float#**(other) -> Float (6213.0)

算術演算子。冪を計算します。

...算術演算子。冪を計算します。

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

//emlist[例][ruby]{
# 冪
1.2 ** 3.0 # => 1.7279999999999998
3.0 + 4.5 - 1.3 / 2.4 * 3 % 1.2 ** 3.0 # => 5.875
0.0 ** 0 # => 1.0
//}...

Float#divmod(other) -> [Numeric] (137.0)

self を other で割った商 q と余り r を、 [q, r] という 2 要素の配列にして返します。 商 q は常に整数ですが、余り r は整数であるとは限りません。

...余り r は整数であるとは限りません。

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

*
self == other * q + r

*
other > 0 のとき: 0 <= r < other
*
other < 0 のとき: other < r <= 0
*
q は整数
をみたす数です。
このメソッドは、メソッド / と % によ...
...ます。

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

Float#round(ndigits = 0) -> Integer | Float (137.0)

自身ともっとも近い整数もしくは実数を返します。

...自身ともっとも近い整数もしくは実数を返します。

中央値 0.5, -0.5 はそれぞれ 1,-1 に切り上げされます。
いわゆる四捨五入ですが、偶数丸めではありません。

@param ndigits 丸める位を指定します。
ndigitsが0ならば、小...
...方を指定します。
サポートされている値は以下の通りです。

*
:up or nil: 0から遠い方に丸められます。
*
:even: もっとも近い偶数に丸められます。
*
:down: 0に近い方に丸められます。

@return 指定された引数に応じて、...
...-1) # => 93650
t.round(-2) # => 93600
t.round(-3) # => 94000
t.round(-100) # => 0

2.5.round(half: :up) # => 3
2.5.round(half: :even) # => 2
2.5.round(half: :down) # => 2
3.5.round(half: :up) # => 4
3.5.round(half: :even) # => 4
3.5.round(half: :down) # => 3
//}

@see Float#ceil, Float...

Float#round(ndigits = 0, half: :up) -> Integer | Float (137.0)

自身ともっとも近い整数もしくは実数を返します。

...自身ともっとも近い整数もしくは実数を返します。

中央値 0.5, -0.5 はそれぞれ 1,-1 に切り上げされます。
いわゆる四捨五入ですが、偶数丸めではありません。

@param ndigits 丸める位を指定します。
ndigitsが0ならば、小...
...方を指定します。
サポートされている値は以下の通りです。

*
:up or nil: 0から遠い方に丸められます。
*
:even: もっとも近い偶数に丸められます。
*
:down: 0に近い方に丸められます。

@return 指定された引数に応じて、...
...-1) # => 93650
t.round(-2) # => 93600
t.round(-3) # => 94000
t.round(-100) # => 0

2.5.round(half: :up) # => 3
2.5.round(half: :even) # => 2
2.5.round(half: :down) # => 2
3.5.round(half: :up) # => 4
3.5.round(half: :even) # => 4
3.5.round(half: :down) # => 3
//}

@see Float#ceil, Float...

絞り込み条件を変える