47件ヒット
[1-47件を表示]
(0.134秒)
ライブラリ
- ビルトイン (11)
-
bigdecimal
/ math (11) - cmath (6)
- mathn (8)
キーワード
- asinh (11)
-
bigdecimal
/ math (11) - rsqrt (4)
検索結果
先頭5件
-
BigMath
. # sqrt(x , prec) -> BigDecimal (24207.0) -
x の平方根を prec で指定した精度で計算します。
...果の精度。
@raise FloatDomainError x に 0 以下、もしくは NaN が指定された場合に発生します。
@raise ArgumentError prec に 0 未満が指定された場合に発生します。
//emlist[][ruby]{
require "bigdecimal/math"
puts BigMath::sqrt(BigDecimal('2'), 10) #=> 0.14... -
Math
. # sqrt(a) -> Numeric (21201.0) -
@todo
...@todo
a の正の平方根を返します。
a が Complex の時は、Complex を返します。
a が負の時は、a を正にして、その平方根を Complex の虚数部に入れて返します。
それ以外は、Math.rsqrt の結果を返します。... -
CMath
. # sqrt(z) -> Float | Complex (21131.0) -
z の平方根を返します。
...z の平方根を返します。
@param z 数値
@raise TypeError z に数値以外を指定した場合に発生します。
//emlist[例][ruby]{
require "cmath"
CMath.sqrt(-1) # => (0+1.0i)
CMath.sqrt(1)# => 1.0
CMath.sqrt(Complex(0, 8))# => (2.0+2.0i)
//}... -
Math
. # asinh(x) -> Float (12206.0) -
x の逆双曲線正弦関数(area hyperbolic sine)の値を返します。
...ea hyperbolic sine)の値を返します。
=== 定義
asinh(x) = log(x + sqrt(x * x + 1))
@param x 実数
@raise TypeError x に数値以外を指定した場合に発生します。
@raise RangeError x に実数以外の数値を指定した場合に発生します。
@see Math.#sinh... -
bigdecimal
/ math (12006.0) -
BigDecimalを使った数学的な機能を提供します。
...BigDecimalを使った数学的な機能を提供します。
以下の計算が行えます。
* sqrt(x, prec)
* sin (x, prec)
* cos (x, prec)
* atan(x, prec)
* PI (prec)
* E (prec)
引数:
: x
計算対象の BigDecimal オブジェクト。
: prec
計算結果の精度。
//e......mlist[例][ruby]{
require "bigdecimal"
require "bigdecimal/math"
include BigMath
a = BigDecimal((PI(100)/2).to_s)
puts sin(a,100)
#=> 0.99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999998765917571575217785e0
//}... -
Math
. # rsqrt(a) -> Numeric (9200.0) -
@todo
...do
複素数を考慮しないので、負の数や Complex をあたえないでください。
a が Float の時は、Float を返します。
それ以外の時、平方根が有理数であれば、Rational または Integer を返します。
無理数であれば、Float を返します。...