ライブラリ
- ビルトイン (661)
- bigdecimal (33)
-
bigdecimal
/ math (66) - cmath (246)
-
irb
/ ext / math-mode (12) -
irb
/ extend-command (11) - mathn (8)
- matrix (11)
- rake (11)
クラス
- Complex (44)
- Float (52)
-
IRB
:: Context (12) - Integer (29)
- Module (30)
- Numeric (44)
-
Rake
:: FileList (11) - Range (22)
- Vector (11)
モジュール
- BigMath (88)
- CMath (240)
- Enumerable (44)
-
IRB
:: ContextExtender (11) - Kernel (22)
- Math (327)
オブジェクト
- main (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - BigMath (11)
- CMath (6)
- DomainError (11)
- E (22)
- Float (11)
- Marshal フォーマット (11)
-
NEWS for Ruby 2
. 2 . 0 (10) -
NEWS for Ruby 2
. 4 . 0 (8) - PI (22)
- Random (11)
- Ruby用語集 (11)
- acos (17)
- acos! (6)
- acosh (17)
- acosh! (6)
- angle (33)
-
angle
_ with (11) - arg (33)
- asin (17)
- asin! (6)
- asinh (17)
- asinh! (6)
- atan (28)
- atan! (6)
- atan2 (17)
- atan2! (6)
- atanh (17)
- atanh! (6)
- bigdecimal (11)
-
bigdecimal
/ math (11) - bsearch (22)
- cbrt (17)
- cbrt! (6)
- cmath (6)
- cos (28)
- cos! (6)
- cosh (17)
- cosh! (6)
- digits (22)
- erf (11)
- erfc (11)
- exp (28)
- exp! (6)
- frexp (11)
- gamma (11)
- hypot (11)
- include (33)
-
install
_ extend _ commands (11) - irb (4)
-
irb
/ ext / math-mode (4) - ldexp (11)
- lgamma (11)
- log (45)
- log! (12)
- log10 (17)
- log10! (6)
- log2 (17)
- log2! (6)
- math? (4)
-
math
_ mode (4) -
math
_ mode= (4) - mathn (4)
-
max
_ by (44) -
module
_ function (19) - phase (33)
- polar (22)
- printf (22)
- round (19)
- rsqrt (4)
-
ruby 1
. 6 feature (11) -
ruby 1
. 9 feature (11) - sin (28)
- sin! (6)
- sinh (17)
- sinh! (6)
- sqrt (39)
- sqrt! (6)
- tan (17)
- tan! (6)
- tanh (17)
- tanh! (6)
- メソッド呼び出し(super・ブロック付き・yield) (11)
検索結果
先頭5件
-
Module
# include(*mod) -> self (12.0) -
モジュール mod をインクルードします。
...承の代わりに用いられており、 mix-in とも呼びます。
//emlist[例][ruby]{
class C
include FileTest
include Math
end
p C.ancestors
# => [C, Math, FileTest, Object, Kernel]
//}
モジュールの機能追加は、クラスの継承関係の間にそのモジュールが挿... -
Ruby用語集 (12.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...dule function
モジュールのインスタンスメソッドおよび特異メソッドとして二重に定義されている
メソッド。Math モジュールのメソッドなどがこれにあたる。
Module#module_function を使って簡単に定義できる。
: 文字列
: strin......プログラム中に直接記述された値のこと。3.14 や "foo" や /\d+/ はリテラル
だが、1 + 2 はリテラルではない。
Math::PI も定数参照なのでリテラルではない。
文字列リテラルが式展開を含む場合、実行時まで値が確定しな... -
ruby 1
. 9 feature (12.0) -
ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。
...ました [new]
#: VIS_MASK が 16
: ancestors にモジュールが複数回挿入できるようになりました
: Math#log2 追加 ((<ruby-talk:191237>)) [new]
: Math#log にオプショナルな第2引数 base 追加 ((<ruby-talk:191308>)) [compat]
: Array#flatten, Array#flatten! が... -
Complex
# angle -> Float (6.0) -
自身の偏角を[-π,π]の範囲で返します。
...自身の偏角を[-π,π]の範囲で返します。
//emlist[例][ruby]{
Complex.polar(3, Math::PI/2).arg # => 1.5707963267948966
//}
非正の実軸付近での挙動に注意してください。以下の例のように虚部が 0.0 と
-0.0 では値が変わります。
//emlist[例][ruby]... -
Complex
# arg -> Float (6.0) -
自身の偏角を[-π,π]の範囲で返します。
...自身の偏角を[-π,π]の範囲で返します。
//emlist[例][ruby]{
Complex.polar(3, Math::PI/2).arg # => 1.5707963267948966
//}
非正の実軸付近での挙動に注意してください。以下の例のように虚部が 0.0 と
-0.0 では値が変わります。
//emlist[例][ruby]... -
Complex
# phase -> Float (6.0) -
自身の偏角を[-π,π]の範囲で返します。
...自身の偏角を[-π,π]の範囲で返します。
//emlist[例][ruby]{
Complex.polar(3, Math::PI/2).arg # => 1.5707963267948966
//}
非正の実軸付近での挙動に注意してください。以下の例のように虚部が 0.0 と
-0.0 では値が変わります。
//emlist[例][ruby]... -
Complex
. polar(r , theta = 0) -> Complex (6.0) -
絶対値が r、偏角が theta である Complex クラスのオブジェクトを生成します。
...。
@param theta 生成する複素数の偏角。単位はラジアンです。省略した場合は 0 です。
//emlist[例][ruby]{
Complex.polar(2.0) # => (2.0+0.0i)
Complex.polar(2.0, 0) # => (2.0+0.0i)
Complex.polar(2.0, Math::PI) # => (-2.0+2.4492127076447545e-16i)
//}... -
Enumerable
# max _ by -> Enumerator (6.0) -
各要素を順番にブロックに渡して実行し、 その評価結果を <=> で比較して、 最大であった値に対応する元の要素、もしくは最大の n 要素が降順で入った配列を返します。
...ue 5 (16 March 2006)
def wsample(n)
self.max_by(n) {|v| rand ** (1.0/yield(v)) }
end
end
e = (-20..20).to_a*10000
a = e.wsample(20000) {|x|
Math.exp(-(x/5.0)**2) # normal distribution
}
# a is 20000 samples from e.
p a.length #=> 20000
h = a.group_by {|x| x }
-10.upto(10) {|x| puts "*" * (... -
Enumerable
# max _ by {|item| . . . } -> object | nil (6.0) -
各要素を順番にブロックに渡して実行し、 その評価結果を <=> で比較して、 最大であった値に対応する元の要素、もしくは最大の n 要素が降順で入った配列を返します。
...ue 5 (16 March 2006)
def wsample(n)
self.max_by(n) {|v| rand ** (1.0/yield(v)) }
end
end
e = (-20..20).to_a*10000
a = e.wsample(20000) {|x|
Math.exp(-(x/5.0)**2) # normal distribution
}
# a is 20000 samples from e.
p a.length #=> 20000
h = a.group_by {|x| x }
-10.upto(10) {|x| puts "*" * (... -
Enumerable
# max _ by(n) -> Enumerator (6.0) -
各要素を順番にブロックに渡して実行し、 その評価結果を <=> で比較して、 最大であった値に対応する元の要素、もしくは最大の n 要素が降順で入った配列を返します。
...ue 5 (16 March 2006)
def wsample(n)
self.max_by(n) {|v| rand ** (1.0/yield(v)) }
end
end
e = (-20..20).to_a*10000
a = e.wsample(20000) {|x|
Math.exp(-(x/5.0)**2) # normal distribution
}
# a is 20000 samples from e.
p a.length #=> 20000
h = a.group_by {|x| x }
-10.upto(10) {|x| puts "*" * (...