ライブラリ
クラス
モジュール
オブジェクト
-
Readline
:: HISTORY (11)
キーワード
- % (22)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - Lazy (11)
- Marshal フォーマット (11)
-
NEWS for Ruby 2
. 2 . 0 (10) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - Numeric (11)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (11)
- [] (34)
- abs (11)
- abs2 (11)
- bigdecimal (11)
-
bit
_ length (17) - create (20)
- encode (33)
-
enum
_ for (22) - exp! (6)
- expires (11)
-
fiddle
/ import (11) -
for
_ fd (11) - format (11)
- frexp (11)
- getrlimit (11)
- inject (33)
-
int
_ from _ prime _ division (11) - irb (11)
- lazy (11)
- load (11)
- log (22)
- log10 (11)
- magnitude (11)
-
max
_ by (44) -
mod
_ exp (11) -
mod
_ sqr (11) - modulo (11)
- new (23)
- open (42)
- parameters (22)
-
parse
_ csv (11) - pipe (88)
- pow (22)
- power (22)
-
prime
_ division (33) - read (33)
- realtime (11)
- reduce (33)
- remainder (11)
- restore (11)
- round (19)
-
ruby 1
. 6 feature (11) -
ruby 1
. 9 feature (11) -
ruby
_ stack _ length (11) -
set
_ encoding (33) - split (11)
- sprintf (11)
- sprintf フォーマット (11)
- sqrt (7)
-
st
_ delete (11) -
st
_ delete _ safe (11) -
st
_ lookup (11) - then (12)
- timeout (19)
-
to
_ csv (11) -
to
_ enum (22) -
to
_ f (11) -
to
_ h (12) - uniq (22)
- with (2)
- write (33)
-
yield
_ self (14) - クラス/メソッドの定義 (11)
- 演算子式 (11)
検索結果
先頭5件
-
Integer
# **(other) -> Numeric (18136.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... -
Rational
# **(other) -> Rational | Float (18124.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 (18118.0) -
算術演算子。冪(べき乗)を計算します。
...算術演算子。冪(べき乗)を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1... -
Fixnum
# **(other) -> Fixnum | Bignum | Float (18118.0) -
算術演算子。冪(べき乗)を計算します。
...算術演算子。冪(べき乗)を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1... -
Float
# **(other) -> Float (18118.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
//}... -
Complex
# **(other) -> Complex (18106.0) -
冪(べき)乗を計算します。
...冪(べき)乗を計算します。
@param other 自身を other 乗する数
//emlist[例][ruby]{
Complex('i') ** 2 # => (-1+0i)
//}... -
BigDecimal
# **(n) -> BigDecimal (18100.0) -
self の n 乗を計算します。
self の n 乗を計算します。
戻り値の有効桁数は self の有効桁数の n 倍以上になります。
@param n selfを other 乗する数を指定します。
@param prec 有効桁数を整数で指定します。self の n 乗を計算します。
戻り値の有効桁数は self の有効桁数の n 倍以上になります。
@param n selfを other 乗する数を指定します。
@param prec 有効桁数を整数で指定します。
@see Integer#pow -
Matrix
# **(n) -> Matrix (18100.0) -
self の n 乗を返します。
self の n 乗を返します。
@param n べき数の指定
@raise ExceptionForMatrix::ErrNotRegular n が 0 以下で、行列が正則でない場合に発生します -
OpenSSL
:: BN # **(other) -> OpenSSL :: BN (18100.0) -
自身の other 乗を返します。
自身の other 乗を返します。
@param other 指数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#mod_exp -
Rational
# **(rhs) -> Numeric (18100.0) -
@todo
@todo
self のべき乗を返します。 Rational になるようであれば Rational で返します。 -
Integer
# pow(other) -> Numeric (3036.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 (3036.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...