From: Shota Fukumori Date: 2011-06-17T10:48:20+09:00 Subject: [ruby-core:37193] [Ruby 1.8 - Bug #4894][Assigned] incorrect conversions from BigDecimal to Float Issue #4894 has been updated by Shota Fukumori. Category set to lib Status changed from Open to Assigned Assignee set to Kenta Murata ---------------------------------------- Bug #4894: incorrect conversions from BigDecimal to Float http://redmine.ruby-lang.org/issues/4894 Author: Cannon Matthews Status: Assigned Priority: Normal Assignee: Kenta Murata Category: lib Target version: Ruby 1.8.7 ruby -v: ruby 1.8.7 (2009-06-08 patchlevel 173) [x86_64-linux] =begin I am working with BigDecimals, and was previously using floats. I came across this strange bug where when converting from BigDecimal down to float, zeros in the middle of the number get removed. require 'bigdecimal' #=> true require 'bigdecimal/util' #=> true BigDecimal.new("40.08").to_f #=> 40.8 which are obviously 2 very different numbers. This happens with implicit converisons too: BigDecimal.new("48.08") - 40.00 #=> 8.8 if this has already been fixed, my apologies. =end -- http://redmine.ruby-lang.org