18件ヒット
[1-18件を表示]
(0.039秒)
キーワード
検索結果
-
bigdecimal (38634.0)
-
bigdecimal は浮動小数点数演算ライブラリです。 任意の精度で 10 進表現された浮動小数点数を扱えます。
...bigdecimal は浮動小数点数演算ライブラリです。
任意の精度で 10 進表現された浮動小数点数を扱えます。
//emlist[][ruby]{
require 'bigdecimal'
a = BigDecimal("0.123456789123456789")
b = BigDecimal("123456.78912345678", 40)
print a + b # => 0.123456912580245903456......ります。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1.0") / BigDecimal("0.0") #=> Infinity
BigDecimal("-1.0") / BigDecimal("0.0") #=> -Infinity
//}
無限大を表す BigDecimal オブジェクトを作成する場合、
Kernel.#BigDecimal の引数に "Infinity" や "-Infinity" を......[ruby]{
require "bigdecimal"
File::open("digits.txt", "r") do |file|
s = BigDecimal("0")
while line = file.gets
s = s + BigDecimal(line)
end
puts s # => 0.3e0
end
File::open("digits.txt", "r") do |file|
s = 0
while line = file.gets
s = s + line.to_f
end
puts s # => 0.30000... -
NEWS for Ruby 3
. 0 . 0 (84.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ds (e.g. IO#puts, IO#gets) may invoke the scheduler hook `#io_wait(io, events, timeout)` in a non-blocking execution context. 16786
* Kernel
* Kernel#clone when called with the `freeze: false` keyword will call `#initialize_clone` with the `freeze: false` keyword. 14266
* Kernel#clone when......s unfrozen. 16175
* Kernel#eval when called with two arguments will use `"(eval)"` for `__FILE__` and `1` for `__LINE__` in the evaluated code. 4352
* Kernel#lambda now warns if called without a literal block. 15973
* Kernel.sleep invokes the scheduler hook `#kernel_sleep(...)` in a non-......3768
* Warning
* Warning#warn now supports a category keyword argument. 17122
== Stdlib updates
Outstanding ones only.
* BigDecimal
* Update to BigDecimal 3.0.0
* This version is Ractor compatible.
* Bundler
* Update to Bundler 2.2.3
* CGI
* Update to 0.2.0
* This... -
NEWS for Ruby 3
. 1 . 0 (48.0) -
NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...92
* 1行のメソッド定義が括弧なしで書けるようになりました。例として def foo = puts "Hello" と記述できるようになりました。 private def foo = puts "Hello" はパースされないことに注意してください。 17398
== コマンドラインオプ......ます。 10917
* Integer
* 新規メソッド
* Integer.try_convert が追加されました。 15211
* Kernel
* 変更されたメソッド
* Kernel#load が第2引数にモジュールを渡せるようになり、渡されたモジュールをトップレベルのモジ......バグ修正を除く)
* 以下のdefault gemsが更新されました。
* RubyGems 3.3.3
* base64 0.1.1
* benchmark 0.2.0
* bigdecimal 3.1.1
* bundler 2.3.3
* cgi 0.3.1
* csv 3.2.2
* date 3.2.2
* did_you_mean 1.6.1
* digest 3.1.0
* drb 2.1.0
* erb...