bigdecimal icon indicating copy to clipboard operation
bigdecimal copied to clipboard

Arbitrary-precision decimal floating-point number library for Ruby

Results 41 bigdecimal issues
Sort by recently updated
recently updated
newest added

### Reproduction script ```ruby require 'bundler/inline' gemfile do source 'https://rubygems.org' gem 'bigdecimal', '3.1.1' end a = BigDecimal(1) - BigDecimal(1000) / BigDecimal(1100) b = BigDecimal(2000) / (BigDecimal(1) - a) p b...

nil.to_d should accept a single integer parameter optionally. ``` irb(main):007:0> RUBY_VERSION => "3.2.2" irb(main):008:0> require 'bigdecimal/util' => true irb(main):009:0> 0.0.to_d => 0.0 irb(main):010:0> 0.0.to_d(4) => 0.0 irb(main):012:0> nil.to_d => 0.0...

In code from test_div_gh220, the last digit of x/y is 8. ```ruby x = BigDecimal("1.0") y = BigDecimal("3672577333.6608990499165058135986328125") c = BigDecimal("0.272288343892592687909520102748926752911779209181321744700032723729015151607289998e-9") x/y -> 0.272288343892592687909520102748926752911779209181321744700032723729015151607289998e-9 ``` On the other hand, if...

We managed to solve #169 by introducing a "stub" gem for the "java" platform, which contains only the .rb files and no extension. This allows JRuby to install the gem...

`Integer#divmod` returns type `[Integer, Integer]` `Float#divmod` returns type `[Integer, Float]` `BigDecimal#divmod` returns type `[BigDecimal, BigDecimal]` Which feels surprising. ``` 1.divmod(2) => [0, 1] (1.0).divmod(2) => [0, 1.0] BigDecimal(1).divmod(2) => [0.0,...

This will fix #222.

I have installed ruby-dev,but still have error: ` gem install bigdecimal Building native extensions. This could take a while... ERROR: Error installing bigdecimal: ERROR: Failed to build gem native extension....

Since #170, `big_decimal.round(0)` returns an Integer. This was surprising to me, as the documentation does not specify the behavior for this case. (It could even be seen as misleading /...

Ruby 3.3 introduces `RUBY_TYPED_EMBEDDABLE`. Now a BigDecimal with a small amount of digits can embed its internal data.

enhancement
help wanted