61件ヒット
[1-61件を表示]
(0.029秒)
検索結果
先頭5件
-
Math
. # log2(x) -> Float (18127.0) -
2 を底とする x の対数(binary logarithm)を返します。
...数を指定した場合に発生します。
@raise RangeError xに実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
Math.log2(1) # => 0.0
Math.log2(2) # => 1.0
Math.log2(32768) # => 15.0
Math.log2(65536) # => 16.0
//}
@see Math.#log, Math.#log10... -
Bignum
# bit _ length -> Integer (8.0) -
self を表すのに必要なビット数を返します。
...。2**n の場合は n+1 になります。self にそのようなビットがない(0 や
-1 である)場合は 0 を返します。
例: ceil(log2(int < 0 ? -int : int+1)) と同じ結果
(-2**10000-1).bit_length # => 10001
(-2**10000).bit_length # => 10000
(-2**10000+1).bit_length... -
Fixnum
# bit _ length -> Integer (8.0) -
self を表すのに必要なビット数を返します。
...。2**n の場合は n+1 になります。self にそのようなビットがない(0 や
-1 である)場合は 0 を返します。
例: ceil(log2(int < 0 ? -int : int+1)) と同じ結果
(-2**12-1).bit_length # => 13
(-2**12).bit_length # => 12
(-2**12+1).bit_length # =>... -
Integer
# bit _ length -> Integer (8.0) -
self を表すのに必要なビット数を返します。
...の場合は n+1 になります。self にそのようなビットがない(0 や
-1 である)場合は 0 を返します。
//emlist[例: ceil(log2(int < 0 ? -int : int+1)) と同じ結果][ruby]{
(-2**12-1).bit_length # => 13
(-2**12).bit_length # => 12
(-2**12+1).bit_length # =>... -
Math
. # log(x) -> Float (8.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 , b) -> Float (8.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
. # log10(x) -> Float (8.0) -
x の常用対数(common logarithm)を返します。
...or x に範囲外の実数を指定した場合に発生します。
@raise RangeError xに実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
Math.log10(1) # => 0.0
Math.log10(10) # => 1.0
Math.log10(10**100) # => 100.0
//}
@see Math.#log, Math.#log2...