るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

キーワード

検索結果

Math.#log2(x) -> Float (18225.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...

CMath.#log2(z) -> Float | Complex (18201.0)

2 を底とする z の対数 (binary logarithm) を返します。

2 を底とする z の対数 (binary logarithm) を返します。

@param z 真数を指定します。

@raise TypeError z に数値以外を指定した場合に発生します。

CMath.#log2!(x) -> Float (6223.0)

2 を底とする実数 x の対数 (binary logarithm) を返します。 Math.#log2のエイリアスです。

...2 を底とする実数 x の対数 (binary logarithm) を返します。
Math.#log2のエイリアスです。

@param x 真数を正の実数で指定します。

@raise Math::DomainError x が負の数である場合に発生します。

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

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

@see Math.#log2...

ruby 1.9 feature (1914.0)

ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。

...w]: 追加されたクラス/メソッドなど
* [compat]: 変更されたクラス/メソッドなど(互換性のある変更) (only backward-compatibility) (影響の範囲が小さいと思われる変更もこちら)
* [change]: 変更されたクラス/メソッドなど(互換性...
...= 1.9.0

=== 2006-09-16

: Struct#inspect

=== 2006-09-14

: digest.rb
: Digest::Base.file

=== 2006-09-13

: Hash#compare_by_identity
: Hash#compare_by_identity?
: Hash#identical
: Hash#identical?

=== 2006-09-12

: Hash#compare_by_identity
: Hash#compare_by_identity?

=== 2006-09-11

: Hash#identi...
...16
: ancestors にモジュールが複数回挿入できるようになりました
: Math#log2 追加 ((<ruby-talk:191237>)) [new]
: Math#log にオプショナルな第2引数 base 追加 ((<ruby-talk:191308>)) [compat]
: Array#flatten, Array#flatten! がオプショナルな level 引数...

Fixnum#bit_length -> Integer (160.0)

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 # => 12
-
0x101.bit_length # => 9
-
0x100.bit_length # => 8
-
0xff....
...bit_length # => 8
-
2.bit_length # => 1
-
1.bit_length # => 0
0.bit_length # => 0
1.bit_length # => 1
0xff.bit_length # => 8
0x100.bit_length # => 9
(2**12-1).bit_length # => 12
(2**12).bit_lengt...

絞り込み条件を変える

Integer#bit_length -> Integer (160.0)

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 # => 12
-
0x101.bit_length # => 9
-
0x100.bit_length # => 8
-
0xff.b...
...it_length # => 8
-
2.bit_length # => 1
-
1.bit_length # => 0
0.bit_length # => 0
1.bit_length # => 1
0xff.bit_length # => 8
0x100.bit_length # => 9
(2**12-1).bit_length # => 12
(2**12).bit_length # => 13
(2**12+1...

Bignum#bit_length -> Integer (142.0)

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 # => 10000

(-2**1000-1).bit_length # => 1001
(-2**1000).bit_leng...
...th # => 1000
(-2**1000+1).bit_length # => 1000

(2**1000-1).bit_length # => 1000
(2**1000).bit_length # => 1001
(2**1000+1).bit_length # => 1001

(2**10000-1).bit_length # => 10000
(2**10000).bit_length # => 10001
(2**10000+1).bit_length # => 10001

@see...

Math.#log(x) -> Float (112.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 (112.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 (106.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...

絞り込み条件を変える