814件ヒット
[1-100件を表示]
(0.126秒)
種類
- インスタンスメソッド (530)
- モジュール関数 (135)
- 特異メソッド (116)
- ライブラリ (22)
- 文書 (11)
ライブラリ
クラス
- BigDecimal (77)
- Bignum (6)
- Complex (44)
-
Enumerator
:: Lazy (44) - Fixnum (6)
- Float (30)
- IO (77)
- Integer (27)
- Object (14)
-
OpenSSL
:: BN (33) - Pathname (11)
- Prime (22)
- Proc (2)
- Rational (26)
-
Rinda
:: TupleEntry (11) - Tempfile (50)
モジュール
オブジェクト
-
Readline
:: HISTORY (11)
キーワード
- % (11)
- Marshal フォーマット (11)
- [] (16)
- abs (11)
- abs2 (11)
- bigdecimal (11)
-
bit
_ length (17) - create (20)
-
enum
_ for (22) - exp! (6)
- expires (11)
- format (11)
- frexp (11)
- getrlimit (11)
- inject (33)
- irb (11)
- lazy (11)
- load (11)
- log (22)
- log10 (11)
- magnitude (11)
-
max
_ by (44) -
mod
_ exp (11) -
mod
_ sqr (11) - modulo (11)
- new (10)
- open (20)
- parameters (2)
- pow (11)
- power (22)
-
prime
_ division (22) - read (33)
- realtime (11)
- reduce (33)
- remainder (11)
- restore (11)
- round (19)
-
set
_ encoding (33) - split (11)
- sprintf (11)
- timeout (19)
-
to
_ enum (22) -
to
_ f (11) -
to
_ h (12) - uniq (22)
- write (22)
-
yield
_ self (14)
検索結果
先頭5件
-
Rational
# **(other) -> Rational | Float (21324.0) -
冪(べき)乗を計算します。
...に Float を指定した場合は、計算結果を Float で返しま
す。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
//}... -
Float
# **(other) -> Float (21318.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 (21306.0) -
冪(べき)乗を計算します。
...冪(べき)乗を計算します。
@param other 自身を other 乗する数
//emlist[例][ruby]{
Complex('i') ** 2 # => (-1+0i)
//}... -
BigDecimal
# **(n) -> BigDecimal (21300.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... -
OpenSSL
:: BN # **(other) -> OpenSSL :: BN (21300.0) -
自身の other 乗を返します。
...自身の other 乗を返します。
@param other 指数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#mod_exp... -
Rational
# **(rhs) -> Numeric (21200.0) -
@todo
...@todo
self のべき乗を返します。 Rational になるようであれば Rational で返します。... -
Bignum
# **(other) -> Fixnum | Bignum | Float (18318.0) -
算術演算子。冪(べき乗)を計算します。
...算術演算子。冪(べき乗)を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1... -
Fixnum
# **(other) -> Fixnum | Bignum | Float (18318.0) -
算術演算子。冪(べき乗)を計算します。
...算術演算子。冪(べき乗)を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1... -
Enumerable
# lazy -> Enumerator :: Lazy (6336.0) -
自身を lazy な Enumerator に変換したものを返します。
...身を lazy な Enumerator に変換したものを返します。
この Enumerator は、以下のメソッドが遅延評価を行う (つまり、配列ではな
くEnumeratorを返す) ように再定義されています。
* map/collect
* flat_map/collect_concat
* select/find_all
* reje......ct
* grep
* take, take_while
* drop, drop_while
* zip (※一貫性のため、ブロックを渡さないケースのみlazy)
* cycle (※一貫性のため、ブロックを渡さないケースのみlazy)
以下はピタゴラス数 (a**2 + b**2 = c**2 を満たす自然数 a, b, c の組)......//emlist[例][ruby]{
def pythagorean_triples
(1..Float::INFINITY).lazy.flat_map {|z|
(1..z).flat_map {|x|
(x..z).select {|y|
x**2 + y**2 == z**2
}.map {|y|
[x, y, z]
}
}
}
end
# 最初の10個のピタゴラス数を表示する
p pythagorean_triples.ta... -
Math
. # log(x) -> Float (6306.0) -
x の対数(logarithm)を返します。
...x の対数(logarithm)を返します。
引数 x, b の両方に 0 を指定した場合は Float::NAN を返します。
@param x 正の実数を指定します。
@param b 底を指定します。省略した場合は自然対数(natural logarithm)を計算します。
@raise TypeErr......らかに負の数を指定した場合に発生します。
//emlist[例][ruby]{
Math.log(0) # => -Infinity
Math.log(1) # => 0.0
Math.log(Math::E) # => 1.0
Math.log(Math::E**3) # => 3.0
Math.log(12, 3) # => 2.2618595071429146
//}
@see Math.#log2, Math.#log10, Math.#exp... -
Math
. # log(x , b) -> Float (6306.0) -
x の対数(logarithm)を返します。
...x の対数(logarithm)を返します。
引数 x, b の両方に 0 を指定した場合は Float::NAN を返します。
@param x 正の実数を指定します。
@param b 底を指定します。省略した場合は自然対数(natural logarithm)を計算します。
@raise TypeErr......らかに負の数を指定した場合に発生します。
//emlist[例][ruby]{
Math.log(0) # => -Infinity
Math.log(1) # => 0.0
Math.log(Math::E) # => 1.0
Math.log(Math::E**3) # => 3.0
Math.log(12, 3) # => 2.2618595071429146
//}
@see Math.#log2, Math.#log10, Math.#exp... -
Math
. # log10(x) -> Float (6306.0) -
x の常用対数(common logarithm)を返します。
...x の常用対数(common logarithm)を返します。
@param x 正の実数
@raise TypeError xに数値以外を指定した場合に発生します。
@raise Math::DomainError x に範囲外の実数を指定した場合に発生します。
@raise RangeError xに実数以外の数値を......指定した場合に発生します。
//emlist[例][ruby]{
Math.log10(1) # => 0.0
Math.log10(10) # => 1.0
Math.log10(10**100) # => 100.0
//}
@see Math.#log, Math.#log2...