るりまサーチ (Ruby 3.0)

最速Rubyリファレンスマニュアル検索!
10件ヒット [1-10件を表示] (0.099秒)
トップページ > クエリ:t[x] > クエリ:sqrt[x] > バージョン:3.0[x]

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

ライブラリ

クラス

モジュール

キーワード

検索結果

Integer.sqrt(n) -> Integer (72766.0)

非負整数 n の整数の平方根を返します。すなわち n の平方根以下の 最大の非負整数を返します。

非負整数 n の整数の平方根を返します。すなわち n の平方根以下の
最大の非負整数を返します。

@param n 非負整数。Integer ではない場合は、最初に Integer に変換されます。
@raise Math::DomainError n が負の整数の時に発生します。

//emlist[][ruby]{
Integer.sqrt(0) # => 0
Integer.sqrt(1) # => 1
Integer.sqrt(24) # => 4
Integer.sqrt(25) # => 5
Integer.sqrt(10**...

Math.#sqrt(x) -> Float (72658.0)

x の非負の平方根(principal square root)を返します。

...[1, 1.0, 1.0]
# [2, 1.4142135623731, 2.0]
# [3, 1.73205080756888, 3.0]
# [4, 2.0, 4.0]
# [5, 2.23606797749979, 5.0]
# [6, 2.44948974278318, 6.0]
# [7, 2.64575131106459, 7.0]
# [8, 2.82842712474619, 8.0]
# [9, 3.0, 9.0]
# [10, 3.16227766016838, 10.0]
//}

@see Integer.sqrt, Math.#...

BigMath.#sqrt(x, prec) -> BigDecimal (72622.0)

x の平方根を prec で指定した精度で計算します。

x の平方根を prec で指定した精度で計算します。

@param x 平方根を求める数。

@param prec 計算結果の精度。

@raise FloatDomainError x に 0 以下、もしくは NaN が指定された場合に発生します。

@raise ArgumentError prec に 0 未満が指定された場合に発生します。

//emlist[][ruby]{
require "bigdecimal/math"

puts BigMath::sqrt(BigDecimal('2'), 10) #=> 0.1414213562373095048666666667e...

BigDecimal#sqrt(n) -> BigDecimal (72604.0)

self の有効桁 n 桁の平方根 (n の平方根ではありません) をニュートン法で 計算します。

self の有効桁 n 桁の平方根 (n の平方根ではありません) をニュートン法で
計算します。

@param n 有効桁数を整数で指定します。

@raise ArgumentError n に負の数を指定した場合に発生します。

Math.#hypot(x, y) -> Float (18349.0)

sqrt(x*x + y*y) を返します。

sqrt(x*x + y*y) を返します。

この値は x, y を直交する 2 辺とする直角三角形の斜辺(hypotenuse)の長さです。

@param x 実数
@param y 実数

@raise TypeError 引数のどちらかに数値以外を指定した場合に発生します。

@raise RangeError 引数のどちらかに実数以外の数値を指定した場合に発生します。

//emlist[例][ruby]{
Math.hypot(3, 4) #=> 5.0
//}

絞り込み条件を変える

Math.#cbrt(x) -> Float (18319.0)

x の立方根(cubic root)を返します。

...67, -5.0]
# [-4, -1.5874010519682, -4.0]
# [-3, -1.44224957030741, -3.0]
# [-2, -1.25992104989487, -2.0]
# [-1, -1.0, -1.0]
# [0, 0.0, 0.0]
# [1, 1.0, 1.0]
# [2, 1.25992104989487, 2.0]
# [3, 1.44224957030741, 3.0]
# [4, 1.5874010519682, 4.0]
# [5, 1.7099759466767, 5.0]
# [6, 1....

bigdecimal/math (18019.0)

BigDecimalを使った数学的な機能を提供します。

BigDecimalを使った数学的な機能を提供します。

以下の計算が行えます。

* sqrt(x, prec)
* sin (x, prec)
* cos (x, prec)
* atan(x, prec)
* PI (prec)
* E (prec)

引数:

: x

計算対象の BigDecimal オブジェクト。

: prec

計算結果の精度。

//emlist[例][ruby]{
require "bigdecimal"
require "bigdecimal/math"

include BigMath

a = BigDecimal((PI(...

Complex#magnitude -> Numeric (9319.0)

自身の絶対値を返します。

自身の絶対値を返します。

以下の計算の結果を Float オブジェクトで返します。

sqrt(self.real ** 2 + self.imag ** 2)

//emlist[例][ruby]{
Complex(1, 2).abs # => 2.23606797749979
Complex(3, 4).abs # => 5.0
Complex('1/2', '1/2').abs # => 0.7071067811865476
//}

@see Complex#abs2

Math.#acosh(x) -> Float (9319.0)

x の逆双曲線余弦関数(area hyperbolic cosine)の値を返します。

x の逆双曲線余弦関数(area hyperbolic cosine)の値を返します。

=== 定義

acosh(x) = log(x + sqrt(x * x - 1)) [x >= 1]

@param x x >= 1 の範囲の実数

@raise TypeError x に数値以外を指定した場合に発生します。

@raise Math::DomainError x に範囲外の実数を指定した場合に発生します。

@raise RangeError x に実数以外の数値を指定した場合に発生します。

@see Math.#cosh

Math.#asinh(x) -> Float (9319.0)

x の逆双曲線正弦関数(area hyperbolic sine)の値を返します。

x の逆双曲線正弦関数(area hyperbolic sine)の値を返します。

=== 定義

asinh(x) = log(x + sqrt(x * x + 1))

@param x 実数

@raise TypeError x に数値以外を指定した場合に発生します。

@raise RangeError x に実数以外の数値を指定した場合に発生します。

@see Math.#sinh

絞り込み条件を変える