るりまサーチ (Ruby 2.6.0)

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

キーワード

検索結果

Math.#cbrt(x) -> Float (42310.0)

x の立方根(cubic root)を返します。

...す。

@raise RangeError xに実数以外の数値を指定した場合に発生します。

//emlist[例][ruby]{
-9.upto(9) {|x|
p [x, Math.cbrt(x), Math.cbrt(x)**3]
}
# => [-9, -2.0800838230519, -9.0]
# [-8, -2.0, -8.0]
# [-7, -1.91293118277239, -7.0]
# [-6, -1.81712059283214, -6.0]
#...
....0, -1.0]
# [0, 0.0, 0.0]
# [1, 1.0, 1.0]
# [2, 1.25992104989487, 2.0]
# [3, 1.44224957030741, 3.0]
# [4, 1.5874010519682, 4.0]
# [5, 1.7099759466767, 5.0]
# [6, 1.81712059283214, 6.0]
# [7, 1.91293118277239, 7.0]
# [8, 2.0, 8.0]
# [9, 2.0800838230519, 9.0]
//}

@see Math.#sqrt...

Math.#log(x, b) -> Float (24349.0)

x の対数(logarithm)を返します。

...らかに負の数を指定した場合に発生します。

//emlist[例][ruby]{
Math
.log(0) # => -Infinity
Math
.log(1) # => 0.0
Math
.log(Math::E) # => 1.0
Math
.log(Math::E**3) # => 3.0
Math
.log(12, 3) # => 2.2618595071429146
//}

@see Math.#log2, Math.#log10, Math.#exp...

Math.#log(x) -> Float (24049.0)

x の対数(logarithm)を返します。

...らかに負の数を指定した場合に発生します。

//emlist[例][ruby]{
Math
.log(0) # => -Infinity
Math
.log(1) # => 0.0
Math
.log(Math::E) # => 1.0
Math
.log(Math::E**3) # => 3.0
Math
.log(12, 3) # => 2.2618595071429146
//}

@see Math.#log2, Math.#log10, Math.#exp...