るりまサーチ

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

関連するキーワード

  1. rational
  2. _builtin
  3. rational
  4. matrix
  5. bignum

ライブラリ

検索結果

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

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

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

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

# 冪
p 1.2 ** 3.0 #=> 1.728
p 3.0 + 4.5 - 1.3 / 2.4 * 3 % 1.2 ** 3.0 #=> 5.875
p 0.0 ** 0 #=> 1.0...

Float#round(ndigits = 0) -> Fixnum | Float (7)

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

...und(3) #=> 3.142
p t.round(0) #=> 3
p t.round(1) #=> 3.1

p t = t**10 #=> 93648.04747608298
p t.round(-0) #=> 93648
p t.round(-1) #=> 93650
p t.round(-2) #=> 93600
p t.round(-3) #=> 94000
p t.round(-100) #=> 0


@see Float#ceil, Float#floor, Float#truncate...