るりまサーチ (Ruby 2.6.0)

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

別のキーワード

  1. new openssl::bn
  2. new openssl::asn1::asn1data
  3. new openssl::pkey::ec::group
  4. new openssl::x509::certificate
  5. start net::smtp

ライブラリ

クラス

モジュール

キーワード

検索結果

Integer.sqrt(n) -> Integer (54484.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 (54376.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, ...

CMath.#sqrt!(x) -> Float (18424.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.#acosh(x) -> Float (37.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