717件ヒット
[1-100件を表示]
(0.125秒)
ライブラリ
クラス
モジュール
- Benchmark (11)
- Enumerable (56)
- Kernel (22)
- Math (11)
キーワード
- % (11)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - Marshal フォーマット (11)
-
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - Numeric (11)
- bigdecimal (11)
- create (20)
- encode (33)
-
fiddle
/ import (11) -
for
_ fd (11) - format (11)
- frexp (11)
-
int
_ from _ prime _ division (11) - irb (11)
-
max
_ by (44) - new (21)
- open (42)
- parameters (2)
-
parse
_ csv (11) - pipe (44)
- pow (22)
- power (22)
- read (33)
- realtime (11)
- round (16)
-
ruby 1
. 6 feature (11) -
ruby 1
. 9 feature (11) -
ruby
_ stack _ length (11) -
set
_ encoding (22) - split (11)
- sprintf (11)
- sprintf フォーマット (11)
-
st
_ delete (11) -
st
_ delete _ safe (11) -
st
_ lookup (11) -
to
_ csv (11) -
to
_ h (12) - with (2)
- write (33)
- 演算子式 (11)
検索結果
先頭5件
-
Integer
# **(other) -> Numeric (27336.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 (27324.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 (27318.0) -
算術演算子。冪(べき乗)を計算します。
...算術演算子。冪(べき乗)を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1... -
Fixnum
# **(other) -> Fixnum | Bignum | Float (27318.0) -
算術演算子。冪(べき乗)を計算します。
...算術演算子。冪(べき乗)を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1... -
BigDecimal
# **(n) -> BigDecimal (27300.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 (27300.0) -
self の n 乗を返します。
...self の n 乗を返します。
@param n べき数の指定
@raise ExceptionForMatrix::ErrNotRegular n が 0 以下で、行列が正則でない場合に発生します... -
Rational
# **(rhs) -> Numeric (27300.0) -
@todo
...@todo
self のべき乗を返します。 Rational になるようであれば Rational で返します。... -
irb (26216.0)
-
irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
...irb は Interactive Ruby の略です。
irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
=== irb の使い方
Ruby さえ知っていれば irb を使うのは簡単です。
irb コマンドを実行すると、以下のようなプロン......として扱わない
=== irb のカスタマイズ
irb コマンドは起動時に以下のパスを上から順番に探索し、
最初に見つかったファイルを読み込みます。
* $IRBRC (もし環境変数 IRBRC が設定されていれば)
* $HOME/.irbrc (もし環境変数 H......nil
str.match(pattern, pos) -> matchdata or nil
...
//}
=== システム変数
: _
直前の式の実行結果です。
例:
//emlist{
$ irb
irb(main):001:0> 10
=> 10
irb(main):002:0> 2**32
=> 4294967296
irb(main):003:0> _
=> 4294967296
irb(main):004:0> _ - 2**31......== irb のカスタマイズ
irb コマンドは起動時に以下のパスを上から順番に探索し、
最初に見つかったファイルを読み込みます。
* $IRBRC (もし環境変数 IRBRC が設定されていれば)
* $XDG_CONFIG_HOME/irb/irbrc (もし環境変数 XDG_CONFIG_... -
Complex
# **(other) -> Complex (24218.0) -
冪(べき)乗を計算します。
...冪(べき)乗を計算します。
@param other 自身を other 乗する数
//emlist[例][ruby]{
Complex('i') ** 2 # => (-1+0i)
//}... -
Prime
# int _ from _ prime _ division(pd) -> Integer (9236.0) -
素因数分解された結果を元の数値に戻します。
...1**e_1 * p_2**e_2 * .... * p_n**e_n となります。
@param pd 整数のペアの配列を指定します。含まれているペアの第一要素は素因数を、
第二要素はその素因数の指数をあらわします。
//emlist[例][ruby]{
require 'prime'
Prime.int_from_prim......e_division([[2,2], [3,1]]) #=> 12
Prime.int_from_prime_division([[2,2], [3,2]]) #=> 36
//}
@see Prime.int_from_prime_division... -
Integer
# pow(other) -> Numeric (9136.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 (9136.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...