るりまサーチ

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

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. require execute

ライブラリ

クラス

モジュール

キーワード

検索結果

<< < 1 2 >>

BigDecimal#sign -> -3 | -2 | -1 | 0 | 1 | 2 | 3 (24.0)

自身の符号等の性質に応じて、Integer を返します。

...0。 BigDecimal::SIGN_NaN と同じです。
+0 であれば、 1。 BigDecimal::SIGN_POSITIVE_ZERO と同じです。
-0 であれば、-1。 BigDecimal::SIGN_NEGATIVE_ZERO と同じです。
有限の正の値 であれば、 2。 BigDecimal::SIGN_POSITIVE_FINITE と同じ...
...あっても、+ か - の符号を持つことに注意して下さい。
(「lib:bigdecimal#internal_structure」を参照)

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

p BigDecimal("NaN").sign # => 0
p BigDecimal("0").sign # => 1
p BigDecimal("100").sign # => 2
p BigDecimal("In...
...finity").sign # => 3
p BigDecimal("-0").sign # => -1
p BigDecimal("-5").sign # => -2
p BigDecimal("-Infinity").sign # => -3

p BigDecimal("0").sign == BigDecimal::SIGN_POSITIVE_ZERO # => true
//}...

Ruby用語集 (24.0)

Ruby用語集 A B C D E F G I J M N O R S Y

...%記法
: % notation
「%」記号で始まる多種多様なリテラル記法の総称。

参照:d:spec/literal#percent

: 0 オリジン
: zero-based
番号が 0 から始まること。

例えば、
Array や Vector、Matrix などの要素の番号、
String における文字...
...まれているクラス。
ライブラリーを require することなく使うことができる。

参照:_builtin

: 組み込みライブラリー
: built-in library
Ruby 本体に組み込まれているライブラリー。require せずに使うことができる。

: クラス
:...
...る。

Ruby 2.7 以降では case/in の As パターンでも使う。

参照:d:spec/literal#hash

: ロードパス
スクリプトを require、load などで読み込む(ロードする)とき、
ファイルの位置を絶対パスで与えなくても、ファイル名(拡張...

String#unpack(template) -> Array (24.0)

Array#pack で生成された文字列を テンプレート文字列 template にしたがってアンパックし、 それらの要素を含む配列を返します。

..."0" ? +1.0 : -1.0
exp = Integer("0b" + e)
fra = Integer("0b" + f)
if exp == 0
if fra == 0
sgn * 0 # ±0 (positive/negative zero)
else
sgn * fra * 2**(-126-23) # 非正規化数 (denormalized number)
end
elsif exp == 255
if fra == 0
sgn * Inf...
..."0" ? +1.0 : -1.0
exp = Integer("0b" + e)
fra = Integer("0b" + f)
if exp == 0
if fra == 0
sgn * 0 # ±0 (positive/negative zero)
else
sgn * fra * 2**(-1022-52) # 非正規化数 (denormalized number)
end
elsif exp == 2047
if fra == 0
sgn * Inf...
...ong(その2)
//emlist[][ruby]{
s = "\xFF\xFF\xFF\xFE"
n = s.unpack("N").pack("l").unpack("l")[0]
n # => -2
//}

: IPアドレス
//emlist[][ruby]{
require
'socket'
official_hostname, alias_hostnames, address_family, *address_list = Socket.gethostbyname("localhost")
address_list.find {|address| addre...

pack テンプレート文字列 (24.0)

pack テンプレート文字列

..."0" ? +1.0 : -1.0
exp = Integer("0b" + e)
fra = Integer("0b" + f)
if exp == 0
if fra == 0
sgn * 0 # ±0 (positive/negative zero)
else
sgn * fra * 2**(-126-23) # 非正規化数 (denormalized number)
end
elsif exp == 255
if fra == 0
sgn * Inf...
..."0" ? +1.0 : -1.0
exp = Integer("0b" + e)
fra = Integer("0b" + f)
if exp == 0
if fra == 0
sgn * 0 # ±0 (positive/negative zero)
else
sgn * fra * 2**(-1022-52) # 非正規化数 (denormalized number)
end
elsif exp == 2047
if fra == 0
sgn * Inf...
...ong(その2)
//emlist[][ruby]{
s = "\xFF\xFF\xFF\xFE"
n = s.unpack("N").pack("l").unpack("l")[0]
n # => -2
//}

: IPアドレス
//emlist[][ruby]{
require
'socket'
official_hostname, alias_hostnames, address_family, *address_list = Socket.gethostbyname("localhost")
address_list.find {|address| addre...

bigdecimal/jacobian (18.0)

ヤコビ行列を計算する機能を提供します。

...ヤコビ行列を計算する機能を提供します。

実行例:

require
"bigdecimal"
require
"bigdecimal/jacobian"

...

dfdx = Jacobian.jacobian(f,fx,x)

引数 f には関数を表すオブジェクトを指定します。以下のメソッドに応答でき
る必要があります...
...

: f.values(x)

点 x における関数の値を数値の配列で返します。

: f.zero

0.0 を示す値を返します。

: f.one

1.0 を示す値を返します。

: f.two

2.0 を示す値を返します。

: f.ten

10.0 を示す値を返します。

: f.eps

収束の...

絞り込み条件を変える

bigdecimal/newton (18.0)

ニュートン法を用いて非線形方程式 f(x) = 0 の解 x を求める機能を提供しま す。

...x) = 0 の解 x を求める機能を提供しま
す。

本サブライブラリは BigDecimal に依存しません。

実行例:

require
"bigdecimal"
require
"bigdecimal/newton"

...

n = Newton.nlsolve(f, x)

引数 f には関数を表すオブジェクトを指定します。以下...
...メソッドに応答でき
る必要があります。

: f.values(x)

点 x における関数の値を数値の配列で返します。

: f.zero

0.0 を示す値を返します。

: f.one

1.0 を示す値を返します。

: f.two

2.0 を示す値を返します。

: f.ten

10.0...
<< < 1 2 >>