るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
8件ヒット [1-8件を表示] (0.024秒)

別のキーワード

  1. _builtin raise
  2. kernel raise
  3. fiber raise
  4. thread raise
  5. e2mmap raise

ライブラリ

クラス

モジュール

キーワード

検索結果

OpenSSL::BN#sqr -> OpenSSL::BN (54340.0)

自身の2乗を計算します。

自身の2乗を計算します。

@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#mod_sqr

CMath.#sqrt!(x) -> Float (18355.0)

実数 x の平方根を返します。Math.#sqrt のエイリアスです。

実数 x の平方根を返します。Math.#sqrt のエイリアスです。

@param x 正の実数

@raise Math::DomainError x が負の数である場合に発生します。

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

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

//emlist[例][ruby]{
require "cmath"
CMath.sqrt!(4.0) # => 2.0
CMath.sqrt!(9.0) # => 3.0
//}

@see Math.#sqrt

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

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

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

@param x 0または正の実数

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

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

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

//emlist[例][ruby]{
0.upto(10) {|x|
p [x, Math.sqrt(x), Math.sqrt(x)**2]
}
# => [0, 0.0, 0.0]
# [1, 1.0, ...

OpenSSL::BN#mod_sqr(m) -> OpenSSL::BN (18340.0)

(self ** 2) % m を返します。

(self ** 2) % m を返します。

@param m mod を取る数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#sqr

BigMath.#sqrt(x, prec) -> BigDecimal (18337.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 (18319.0)

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

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

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

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

CMath.#sqrt(z) -> Float | Complex (18319.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)
//}

Integer.sqrt(n) -> Integer (18319.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**...