るりまサーチ

最速Rubyリファレンスマニュアル検索!
81件ヒット [1-81件を表示] (0.123秒)
トップページ > クエリ:i[x] > クエリ:==[x] > クエリ:bigdecimal[x]

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. bigdecimal to_i
  5. ipaddr to_i

ライブラリ

クラス

検索結果

bigdecimal (44658.0)

bigdecimal は浮動小数点数演算ライブラリです。 任意の精度で 10 進表現された浮動小数点数を扱えます。

...bigdecimal は浮動小数点数演算ライブラリです。
任意の精度で 10 進表現された浮動小数点数を扱えます。

//emlist[][ruby]{
require 'bigdecimal'
a = BigDecimal("0.123456789123456789")
b = BigDecimal("123456.78912345678", 40)
print a + b # => 0.123456912580245903456...
...BigDecimal では正確な値を得る事ができます。

//emlist[例1: 0.0001 を 10000 回足す場合。][ruby]{
sum = 0
for i in (1..10000)
sum = sum + 0.0001
end
print sum # => 0.9999999999999062
//}

//emlist[例2: 0.0001 を 10000 回足す場合。(BigDecimal)][ruby]{
require 'bigdecim...
...sum = BigDecimal("0")
for i in (1..10000)
sum = sum + BigDecimal("0.0001")
end
print sum # => 0.1e1
//}

//emlist[例3: 1.2 - 1.0 と 0.2 との比較][ruby]{
require "bigdecimal"

(BigDecimal("1.2") - BigDecimal("1.0")) == BigDecimal("0.2") # => true

(1.2 - 1.0) == 0.2 # => false
//}

==
= 特...

BigDecimal#==(other) -> bool (38124.0)

self が other と等しい場合に true を、そうでない場合に false を返します。

...self が other と等しい場合に true を、そうでない場合に false を返します。

それぞれの値は BigDecimal#coerce で変換して比較される場合があります。

//emlist[][ruby]{
require 'bigdecimal'
BigDecimal
('1.0') == 1.0 # => true
//}...

BigDecimal#===(other) -> bool (29224.0)

self が other と等しい場合に true を、そうでない場合に false を返します。

...self が other と等しい場合に true を、そうでない場合に false を返します。

それぞれの値は BigDecimal#coerce で変換して比較される場合があります。

//emlist[][ruby]{
require 'bigdecimal'
BigDecimal
('1.0') == 1.0 # => true
//}...

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

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

...て、Integer を返します。

符号が正であれば正の整数を返し、負であれば負の整数を返し、NaN であれば 0 を返します。

NaN であれば、 0。 BigDecimal::SIGN_NaN と同じです。
+0 であれば、 1。 BigDecimal::SIGN_POSITIVE_ZERO...
... BigDecimal::SIGN_NEGATIVE_ZERO と同じです。
有限の正の値 であれば、 2。 BigDecimal::SIGN_POSITIVE_FINITE と同じです。
有限の負の値 であれば、-2。 BigDecimal::SIGN_NEGATIVE_FINITE と同じです。
+Infinity であれば、 3。 BigDecimal::SIGN_POSITIVE_I...
...p BigDecimal("NaN").sign # => 0
p BigDecimal("0").sign # => 1
p BigDecimal("100").sign # => 2
p BigDecimal("Infinity").sign # => 3
p BigDecimal("-0").sign # => -1
p BigDecimal("-5").sign # => -2
p BigDecimal("-Infinity").sign # => -3

p BigDecimal("0").sign ==...

BigDecimal#eql?(other) -> bool (23024.0)

self が other と等しい場合に true を、そうでない場合に false を返します。

...self が other と等しい場合に true を、そうでない場合に false を返します。

それぞれの値は BigDecimal#coerce で変換して比較される場合があります。

//emlist[][ruby]{
require 'bigdecimal'
BigDecimal
('1.0') == 1.0 # => true
//}...

絞り込み条件を変える

1.6.8から1.8.0への変更点(まとめ) (636.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...の変更点(まとめ)/Windows 対応>))
* ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>))
* ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>))
* ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>))
* ((<1.6.8から1.8.0...
...トフォームの追加>))

==
インタプリタの変更

: ((<組み込み変数/$defout>)) [obsolete]
: ((<組み込み変数/$deferr>)) [obsolete]
: ((<組み込み変数/$stdout>)) [change]
: ((<組み込み変数/$stderr>)) [change]
: ((<組み込み変数/$stdin>)) [change]

$stdout, $st...
...)) [lib],[new]

追加

: ((<yaml|YAML>)) [new]

追加。YAML は、YAML Ain't Markup Language だそうです。
((<URL:http://yaml4r.sourceforge.net/>))
((<URL:http://yaml.org/>))

: ((<zlib>)) [lib] [new]

追加

: ((<bigdecimal>)) [lib] [new]

追加

: ((<"test/unit"|Test::Unit>))...

NEWS for Ruby 3.0.0 (78.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...参照してください。

==
言語仕様の変更

* Keyword arguments are now separated from positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywor...
...autosplatting. This now matches the behavior of Procs
accepting a single rest argument and no keywords.
16166

//emlist[][ruby]{
pr = proc{|*a, **kw| [a, kw]}

pr.call([1])
# 2.7 => [[1], {}]
# 3.0 => [[[1]], {}]

pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0...
...Thread.ignore_deadlock accessor has been added for disabling the default deadlock detection, allowing the use of signal handlers to break deadlock. 13768
* Warning
* Warning#warn now supports a category keyword argument. 17122

==
Stdlib updates

Outstanding ones only.

* BigDecimal
* U...

Ruby用語集 (70.0)

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

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

a ka sa ta na ha ma ya ra wa

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

参照:d:spec/literal#percent

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

例えば、
Array や Vector、Matrix などの要素の番号、
String における文字の位置、
といったものは 0 オリジンである。

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

例えば、
エラ...
...: floating point number
実数を符号・仮数部・指数部によって表す表現形式。
仮数部が表す小数の小数点の位置を指数部の値によって動かしていることに
なるのでこの名がある。

Ruby では Float クラスおよび BigDecimal クラ...