るりまサーチ

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

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

Integer#pow(other) -> Numeric (18250.0)

算術演算子。冪(べき乗)を計算します。

...)を計算します。

@param other 二項演算の右側の引数(対象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**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...
... pow で other に負の数を指定した場合に発生します。
@raise ArgumentError 計算結果が巨大になりすぎる場合に発生します。

//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
//}


計算結果が巨大すぎるときは ArgumentError が発生します。

//emlist[計算結果が巨大すぎる例][ruby]{
p 100**9999999999999999999
# => exponent is too large (ArgumentError)
//}

判定の閾値は変わりえます...

Integer#pow(other, modulo) -> Integer (18250.0)

算術演算子。冪(べき乗)を計算します。

...)を計算します。

@param other 二項演算の右側の引数(対象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**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...
... pow で other に負の数を指定した場合に発生します。
@raise ArgumentError 計算結果が巨大になりすぎる場合に発生します。

//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
//}


計算結果が巨大すぎるときは ArgumentError が発生します。

//emlist[計算結果が巨大すぎる例][ruby]{
p 100**9999999999999999999
# => exponent is too large (ArgumentError)
//}

判定の閾値は変わりえます...

power_assert (12000.0)

Ruby向けのPower Assertを提供するライブラリです。

...Power Assertを提供するライブラリです。

このライブラリはbundled gem(gemファイルのみを同梱)です。詳しい内容は下
記のページを参照してください。

* rubygems.org: https://rubygems.org/gems/power_assert
* プロジェクトページ: https://github...
....com/k-tsj/power_assert
* リファレンス: https://www.rubydoc.info/gems/power_assert...

File::Stat#grpowned? -> bool (9100.0)

グループIDが実効グループIDと等しい時に真を返します。

...ープIDと等しい時に真を返します。

補助グループIDは考慮されません。

//emlist[][ruby]{
printf "%s %s\n", $:[0], File::Stat.new($:[0]).grpowned?
#例
#=> /usr/local/lib/site_ruby/1.8 false
printf "%s %s\n", $0, File::Stat.new($0).grpowned?
#例
#=> filestat.rb true
//}...

FileTest.#grpowned?(file) -> bool (9100.0)

ファイルのグループ ID がカレントプロセスの実効グループ ID と等しい時に真を返 します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

...ト file が既に close されていた場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "")
File.chown(-1, Process.gid, "testfile")
FileTest.grpowned?("testfile") # => true
File.chown(-1, Process.gid + 10, "testfile")
FileTest.grpowned?("testfile") # => false
//}...

絞り込み条件を変える

Pathname#grpowned? -> bool (9100.0)

FileTest.grpowned?(self.to_s) と同じです。

...FileTest.grpowned?(self.to_s) と同じです。


@see FileTest.#grpowned?...

Shell::Filter#grpowned?(file) -> bool (9100.0)

FileTest モジュールにある同名のクラスメソッドと同じです.

...FileTest モジュールにある同名のクラスメソッドと同じです.

@param file ファイル名を表す文字列か IO オブジェクトを指定します。

@see FileTest.#grpowned?...

File.grpowned?(path) -> bool (6200.0)

FileTest.#grpowned? と同じです。

...FileTest.#grpowned? と同じです。

@param path パスを表す文字列か IO オブジェクトを指定します。...

Integer#**(other) -> Numeric (3150.0)

算術演算子。冪(べき乗)を計算します。

...)を計算します。

@param other 二項演算の右側の引数(対象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**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...
... pow で other に負の数を指定した場合に発生します。
@raise ArgumentError 計算結果が巨大になりすぎる場合に発生します。

//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
//}


計算結果が巨大すぎるときは ArgumentError が発生します。

//emlist[計算結果が巨大すぎる例][ruby]{
p 100**9999999999999999999
# => exponent is too large (ArgumentError)
//}

判定の閾値は変わりえます...
<< 1 2 > >>