るりまサーチ

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

別のキーワード

  1. openssl integer
  2. asn1 integer
  3. _builtin integer
  4. integer new
  5. integer upto

ライブラリ

クラス

キーワード

検索結果

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

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

... 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 to...
...o big
# Infinity
//}

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

@see BigDecimal#power...

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

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

... 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 to...
...o big
# Infinity
//}

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

@see BigDecimal#power...

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

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

... 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 to...
...o big
# Infinity
//}

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

@see BigDecimal#power...

BigDecimal#power(n) -> BigDecimal (3112.0)

self の n 乗を計算します。

...self の n 乗を計算します。

戻り値の有効桁数は self の有効桁数の n 倍以上になります。

@param n selfを other 乗する数を指定します。

@param prec 有効桁数を整数で指定します。


@see Integer#pow...

BigDecimal#power(n, prec) -> BigDecimal (3112.0)

self の n 乗を計算します。

...self の n 乗を計算します。

戻り値の有効桁数は self の有効桁数の n 倍以上になります。

@param n selfを other 乗する数を指定します。

@param prec 有効桁数を整数で指定します。


@see Integer#pow...

絞り込み条件を変える

NEWS for Ruby 2.5.0 (72.0)

NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...う。 13405

* Integer
* Integer#round, Integer#floor, Integer#ceil, Integer#truncate は常に Integer を返すようになりました
13420
* Integer#pow を追加 12508 11003
* Integer#allbits?, Integer#anybits?, Integer#nobits? を追加 12753
* Integer.sqrt を追加...

ruby 1.9 feature (36.0)

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

...の文字列に対し、その文字のコードを返すメソッドが追加されました
: string[integer] が 1文字の String を返すようになりました
: string.slice(integer) が 1文字の String を返すようになりました
: ?c が 1文字の String を返すように...
...ッドを alias した場合、メソッドの定義時の $SAFE に加えて現在の $SAFE も加味されるようになりました
: Bignum#pow で結果が大きすぎる場合にはすぐにエラーが出るようになりました ((<ruby-talk:187984>))
: set_trace_func のバグが修...
...プションの追加
((<ruby-dev:28417>))

=== 2006-02-15

: instance_eval

((<ruby-core:7365>))

=== 2006-02-03

: Integer#upto [compat]
: Integer#downto [compat]
: Integer#doitems [compat]

ブロックがなければ enumerator を返す

: Enumerable#group_by [new]
: Enumerable#first...

BigDecimal#**(n) -> BigDecimal (12.0)

self の n 乗を計算します。

...self の n 乗を計算します。

戻り値の有効桁数は self の有効桁数の n 倍以上になります。

@param n selfを other 乗する数を指定します。

@param prec 有効桁数を整数で指定します。


@see Integer#pow...