別のキーワード
種類
- モジュール関数 (84)
- インスタンスメソッド (48)
- ライブラリ (12)
- 文書 (12)
- モジュール (6)
ライブラリ
- ビルトイン (108)
- bigdecimal (12)
- cmath (18)
モジュール
- BigMath (12)
- CMath (12)
- Enumerable (48)
- Math (60)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - CMath (6)
- bigdecimal (12)
- exp! (6)
- frexp (12)
- ldexp (12)
- log (24)
-
max
_ by (48)
検索結果
先頭5件
-
Math
. # exp(x) -> Float (39155.0) -
x の指数関数(exponential)の値を返します。
...x の指数関数(exponential)の値を返します。
すなわち e の x 乗の値を返します(e は自然対数の底)。
@param x 実数
@raise TypeError x に数値以外を指定した場合に発生します。
@raise RangeError x に実数以外の数値を指定した場合......に発生します。
//emlist[例][ruby]{
Math.exp(0) # => 1.0
Math.exp(1) # => 2.718281828459045
Math.exp(1.5) # => 4.4816890703380645
//}
@see exp(3), Math.#log... -
Math
. # ldexp(x , exp) -> Float (27241.0) -
実数 x に 2 の exp 乗をかけた数を返します。
...実数 x に 2 の exp 乗をかけた数を返します。
@param x 実数
@param exp 整数。小数点以下切捨て。
@raise TypeError 引数のどちらかに数値以外を指定した場合に発生します。
@raise RangeError 引数のどちらかに実数以外の数値を指定し......た場合に発生します。
//emlist[例][ruby]{
fraction, exponent = Math.frexp(1234)
Math.ldexp(fraction, exponent) # => 1234.0
//}... -
Math
. # frexp(x) -> [Float , Integer] (27112.0) -
実数 x の仮数部と指数部の配列を返します。
...ypeError x に数値以外を指定した場合に発生します。
@raise RangeError x に実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
fraction, exponent = Math.frexp(1234) # => [0.6025390625, 11]
fraction * 2**exponent # => 1234.0
//}... -
CMath
. # exp(z) -> Float | Complex (21159.0) -
z の指数関数(Math::E の z 乗)の値を返します。
...関数(Math::E の z 乗)の値を返します。
@param z Math::E を z 乗する数を指定します。
@raise TypeError z に数値以外を指定した場合に発生します。
//emlist[例][ruby]{
require "cmath"
CMath.exp(Complex(0, 0))# => (1.0+0.0i)
CMath.exp(Complex(0, Math::PI)) # =>......(-1.0+1.2246063538223773e-16i)
CMath.exp(Complex(0, Math::PI / 2.0)) # => (6.123031769111886e-17+1.0i)
//}... -
BigMath
. # exp(x , prec) -> BigDecimal (21119.0) -
x の指数関数を prec で指定した精度で計算します。
...onal以外のオブジェクトを指
定した場合に発生します。
@raise ArgumentError prec に 0 以下の数値が指定された場合に発生します。
//emlist[][ruby]{
require "bigdecimal/math"
puts BigMath::exp(BigDecimal('1'), 10) #=> 0.2718281828e1
//}... -
Math
. # log(x) -> Float (21072.0) -
x の対数(logarithm)を返します。
...らかに負の数を指定した場合に発生します。
//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 (21072.0) -
x の対数(logarithm)を返します。
...らかに負の数を指定した場合に発生します。
//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... -
CMath
. # exp!(x) -> Float (9221.0) -
実数 x の指数関数(Math::E の x 乗)の値を返します。 Math.#exp のエイリアスです。
...実数 x の指数関数(Math::E の x 乗)の値を返します。
Math.#exp のエイリアスです。
@param x Math::E を x 乗する数を実数で指定します。
@raise TypeError x に数値以外を指定した場合に発生します。
@raise RangeError x に実数以外の数値を......指定した場合に発生します。
//emlist[例][ruby]{
require "cmath"
CMath.exp!(0) # => 1
CMath.exp!(0.5) # => Math.sqrt(Math::E)
CMath.exp!(1) # => Math::E
CMath.exp!(2) # => Math::E ** 2
//}
@see Math.#exp... -
CMath (6030.0)
-
複素数演算をサポートするモジュールです。
...。
Math モジュールの複素数版です。同名のメソッドを複素数対応します。
従来の計算結果が必要な場合は、「メソッド名!」の形式で呼び出します。
//emlist[例][ruby]{
require "cmath"
# 複素数の範囲の立方根(の主値)= exp(1/3 π......i)
CMath.cbrt(-1) # => (0.5000000000000001+0.8660254037844386i)
# 実数の範囲の立方根
Math.cbrt(-1) # => -1.0
include CMath
# レシーバー無しで使える
cbrt(-1) # => (0.5000000000000001+0.8660254037844386i)
# cbrt! は Math.cbrt のエイリアス
cbrt!(-1) # => -1.0
//}... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (1572.0) -
1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))
...動作はなくなりました)
$defout や $deferr に代入を行うと警告がでます。
(注:1.6 に $deferr はありません)
((<ruby-dev:20961>))
$stdin にオブジェクトを代入すると標準入力からの入力メソッド(gets 等)
はそのオブジェクトにメ......== Math
: ((<Math/Math.erf>)) [new]
: ((<Math/Math.erfc>)) [new]
追加 ((<ruby-list:37753>))
: ((<Math/Math.acos>)) [new]
: ((<Math/Math.asin>)) [new]
: ((<Math/Math.atan>)) [new]
: ((<Math/Math.cosh>)) [new]
: ((<Math/Math.sinh>)) [new]
: ((<Math/M......Regexp
: ((<Regexp#to_s|Regexp/to_s>)) [new]
追加。((<ruby-dev:16909>))
これにより、
re1 = /hogehoge/i
re2 = /fugafuga/
re3 = / #{re1} | #{re2} /x
などと正規表現オブジェクトを正規表現に埋め込めるようになりました。
: ((<Regexp#opt...