[#82706] [Ruby trunk Bug#13851] getting "can't modify string; temporarily locked" on non-frozen instances — cardoso_tiago@...
Issue #13851 has been updated by chucke (Tiago Cardoso).
3 messages
2017/09/07
[#82853] [Ruby trunk Bug#13916] Race condition when sending a signal to a new fork — russell.davis@...
Issue #13916 has been reported by russelldavis (Russell Davis).
3 messages
2017/09/19
[#82892] [Ruby trunk Bug#13921] buffered read_nonblock doesn't work as expected using SSLSocket — cardoso_tiago@...
Issue #13921 has been updated by chucke (Tiago Cardoso).
3 messages
2017/09/20
[ruby-core:82924] [Ruby trunk Bug#13928] Calling Integer.fdiv with BigDecimal returns unexpected result
From:
calle.vander@...
Date:
2017-09-21 21:13:44 UTC
List:
ruby-core #82924
Issue #13928 has been reported by calle.vander@gmail.com (Carl Vander).
----------------------------------------
Bug #13928: Calling Integer.fdiv with BigDecimal returns unexpected result
https://bugs.ruby-lang.org/issues/13928
* Author: calle.vander@gmail.com (Carl Vander)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: 2.4.2p198
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
After upgrading a Rails project from 2.3.1 to 2.4.2 I ran into a number of failing tests. Seems like to behaviour of fdiv and conjuction with bigdecimal is wrong.
**Reproduce by running:**
irb(main):001:0> require 'bigdecimal'
=> true
irb(main):002:0> 1.fdiv(1-BigDecimal.new("0"))
=> 2.1296133346e-314
Ruby version: ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin16]
**I would expect the calculation to return 1, which is correctly done if converting the big decimal to a float first:**
irb(main):006:0> 1.fdiv(1-BigDecimal.new("0").to_f)
=> 1.0
**Using ruby 2.3.1p112, it also looks OK:**
irb(main):001:0> require 'bigdecimal'
=> true
irb(main):002:0> 1.fdiv(1-BigDecimal.new("0"))
=> #<BigDecimal:7fb6b8949690,'0.1E1',9(36)>
irb(main):003:0> 1.fdiv(1-BigDecimal.new("0")).to_i
=> 1
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>