種類
- インスタンスメソッド (289)
- 特異メソッド (147)
- モジュール関数 (33)
- クラス (22)
クラス
モジュール
- Enumerable (67)
- Kernel (22)
- Math (11)
検索結果
先頭5件
-
Integer
# **(other) -> Numeric (32238.0) -
算術演算子。冪(べき乗)を計算します。
...elf**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。
//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0......# => 1
0 ** 0 # => 1
3.pow(3, 8) # => 3
3.pow(3, -8) # => -5
3.pow(2, -2) # => -1
-3.pow(3, 8) # => 5
-3.pow(3, -8) # => -3
5.pow(2, -8) # => -7
//}
結果が巨大すぎる整数になりそうなとき、警告を出したうえで Float::INFINITY を返します。
//emlist[計算を......放棄して Float::INFINITY を返す例][ruby]{
p 100**9999999
# => warning: in a**b, b may be too big
# Infinity
//}
判定の閾値は変わりえます。
@see BigDecimal#power... -
Float
# **(other) -> Float (32226.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
//}... -
Rational
# **(other) -> Rational | Float (32226.0) -
冪(べき)乗を計算します。
...す。other が有理数であっても、計算結果が無理数だった場合は Float
を返します。
//emlist[例][ruby]{
r = Rational(3, 4)
r ** Rational(2, 1) # => (9/16)
r ** 2 # => (9/16)
r ** 2.0 # => 0.5625
r ** Rational(1, 2) # => 0.866025403784439
//}... -
Bignum
# **(other) -> Fixnum | Bignum | Float (32220.0) -
算術演算子。冪(べき乗)を計算します。
...算術演算子。冪(べき乗)を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1... -
Fixnum
# **(other) -> Fixnum | Bignum | Float (32220.0) -
算術演算子。冪(べき乗)を計算します。
...算術演算子。冪(べき乗)を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1... -
Complex
# **(other) -> Complex (32208.0) -
冪(べき)乗を計算します。
...冪(べき)乗を計算します。
@param other 自身を other 乗する数
//emlist[例][ruby]{
Complex('i') ** 2 # => (-1+0i)
//}... -
Integer
# pow(other) -> Numeric (14038.0) -
算術演算子。冪(べき乗)を計算します。
...elf**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。
//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0......# => 1
0 ** 0 # => 1
3.pow(3, 8) # => 3
3.pow(3, -8) # => -5
3.pow(2, -2) # => -1
-3.pow(3, 8) # => 5
-3.pow(3, -8) # => -3
5.pow(2, -8) # => -7
//}
結果が巨大すぎる整数になりそうなとき、警告を出したうえで Float::INFINITY を返します。
//emlist[計算を......放棄して Float::INFINITY を返す例][ruby]{
p 100**9999999
# => warning: in a**b, b may be too big
# Infinity
//}
判定の閾値は変わりえます。
@see BigDecimal#power... -
Integer
# pow(other , modulo) -> Integer (14038.0) -
算術演算子。冪(べき乗)を計算します。
...elf**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。
//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0......# => 1
0 ** 0 # => 1
3.pow(3, 8) # => 3
3.pow(3, -8) # => -5
3.pow(2, -2) # => -1
-3.pow(3, 8) # => 5
-3.pow(3, -8) # => -3
5.pow(2, -8) # => -7
//}
結果が巨大すぎる整数になりそうなとき、警告を出したうえで Float::INFINITY を返します。
//emlist[計算を......放棄して Float::INFINITY を返す例][ruby]{
p 100**9999999
# => warning: in a**b, b may be too big
# Infinity
//}
判定の閾値は変わりえます。
@see BigDecimal#power... -
IO
. for _ fd(fd , mode = "r" , **opts) -> IO (8254.0) -
オープン済みのファイルディスクリプタ fd に対する新しい IO オブジェクトを生成して返します。
...ドは以下のキーワード引数を利用できます。
* :mode mode引数と同じ意味です
* :external_encoding 外部エンコーディング。"-" はデフォルト外部エンコーディングの
別名です。
* :internal_encoding 内部エンコーディング。"-" は......変換しません。
* :encoding "extenc:intenc" の形で外部/内部エンコーディングを指定します。
* :textmode 真を渡すと mode の "t" と同じ意味になります。
* :binmode 真を渡すと mode の "b" と同じ意味になります。
* :autoclose 偽を渡す......と close時/GCでのファイナライザ呼出時に fd を close しません。
* :path 文字列を渡すと、IO#path メソッドがその値を返すようになります。
また、String#encode で説明されている :invalid => :replace などの
変換オプションも指定する... -
IO
. new(fd , mode = "r" , **opts) -> IO (8254.0) -
オープン済みのファイルディスクリプタ fd に対する新しい IO オブジェクトを生成して返します。
...ドは以下のキーワード引数を利用できます。
* :mode mode引数と同じ意味です
* :external_encoding 外部エンコーディング。"-" はデフォルト外部エンコーディングの
別名です。
* :internal_encoding 内部エンコーディング。"-" は......変換しません。
* :encoding "extenc:intenc" の形で外部/内部エンコーディングを指定します。
* :textmode 真を渡すと mode の "t" と同じ意味になります。
* :binmode 真を渡すと mode の "b" と同じ意味になります。
* :autoclose 偽を渡す......と close時/GCでのファイナライザ呼出時に fd を close しません。
* :path 文字列を渡すと、IO#path メソッドがその値を返すようになります。
また、String#encode で説明されている :invalid => :replace などの
変換オプションも指定する... -
IO
. open(fd , mode = "r" , **opts) -> IO (8254.0) -
オープン済みのファイルディスクリプタ fd に対する新しい IO オブジェクトを生成して返します。
...ドは以下のキーワード引数を利用できます。
* :mode mode引数と同じ意味です
* :external_encoding 外部エンコーディング。"-" はデフォルト外部エンコーディングの
別名です。
* :internal_encoding 内部エンコーディング。"-" は......変換しません。
* :encoding "extenc:intenc" の形で外部/内部エンコーディングを指定します。
* :textmode 真を渡すと mode の "t" と同じ意味になります。
* :binmode 真を渡すと mode の "b" と同じ意味になります。
* :autoclose 偽を渡す......と close時/GCでのファイナライザ呼出時に fd を close しません。
* :path 文字列を渡すと、IO#path メソッドがその値を返すようになります。
また、String#encode で説明されている :invalid => :replace などの
変換オプションも指定する... -
IO
. open(fd , mode = "r" , **opts) {|io| . . . } -> object (8254.0) -
オープン済みのファイルディスクリプタ fd に対する新しい IO オブジェクトを生成して返します。
...ドは以下のキーワード引数を利用できます。
* :mode mode引数と同じ意味です
* :external_encoding 外部エンコーディング。"-" はデフォルト外部エンコーディングの
別名です。
* :internal_encoding 内部エンコーディング。"-" は......変換しません。
* :encoding "extenc:intenc" の形で外部/内部エンコーディングを指定します。
* :textmode 真を渡すと mode の "t" と同じ意味になります。
* :binmode 真を渡すと mode の "b" と同じ意味になります。
* :autoclose 偽を渡す......と close時/GCでのファイナライザ呼出時に fd を close しません。
* :path 文字列を渡すと、IO#path メソッドがその値を返すようになります。
また、String#encode で説明されている :invalid => :replace などの
変換オプションも指定する... -
IO
. for _ fd(fd , mode = "r" , **opts) -> IO (8248.0) -
オープン済みのファイルディスクリプタ fd に対する新しい IO オブジェクトを生成して返します。
...ドは以下のキーワード引数を利用できます。
* :mode mode引数と同じ意味です
* :external_encoding 外部エンコーディング。"-" はデフォルト外部エンコーディングの
別名です。
* :internal_encoding 内部エンコーディング。"-" は......変換しません。
* :encoding "extenc:intenc" の形で外部/内部エンコーディングを指定します。
* :textmode 真を渡すと mode の "t" と同じ意味になります。
* :binmode 真を渡すと mode の "b" と同じ意味になります。
* :autoclose 偽を渡す... -
IO
. new(fd , mode = "r" , **opts) -> IO (8248.0) -
オープン済みのファイルディスクリプタ fd に対する新しい IO オブジェクトを生成して返します。
...ドは以下のキーワード引数を利用できます。
* :mode mode引数と同じ意味です
* :external_encoding 外部エンコーディング。"-" はデフォルト外部エンコーディングの
別名です。
* :internal_encoding 内部エンコーディング。"-" は......変換しません。
* :encoding "extenc:intenc" の形で外部/内部エンコーディングを指定します。
* :textmode 真を渡すと mode の "t" と同じ意味になります。
* :binmode 真を渡すと mode の "b" と同じ意味になります。
* :autoclose 偽を渡す... -
IO
. open(fd , mode = "r" , **opts) -> IO (8248.0) -
オープン済みのファイルディスクリプタ fd に対する新しい IO オブジェクトを生成して返します。
...ドは以下のキーワード引数を利用できます。
* :mode mode引数と同じ意味です
* :external_encoding 外部エンコーディング。"-" はデフォルト外部エンコーディングの
別名です。
* :internal_encoding 内部エンコーディング。"-" は......変換しません。
* :encoding "extenc:intenc" の形で外部/内部エンコーディングを指定します。
* :textmode 真を渡すと mode の "t" と同じ意味になります。
* :binmode 真を渡すと mode の "b" と同じ意味になります。
* :autoclose 偽を渡す...