[#29911] [Bug #3231] Digest Does Not Build — Charlie Savage <redmine@...>

Bug #3231: Digest Does Not Build

19 messages 2010/05/01

[#29920] [Feature #3232] Loops (while/until) should return last statement value if any, like if/unless — Benoit Daloze <redmine@...>

Feature #3232: Loops (while/until) should return last statement value if any, like if/unless

9 messages 2010/05/01

[#29997] years in Time.utc — Xavier Noria <fxn@...>

Does anyone have a precise statement about the years supported by

13 messages 2010/05/04

[#30010] [Bug #3248] extension 'tk' is finding tclConfig.sh and tkConfig.sh incorrectly — Luis Lavena <redmine@...>

Bug #3248: extension 'tk' is finding tclConfig.sh and tkConfig.sh incorrectly

9 messages 2010/05/05

[#30226] [Bug #3288] Segmentation fault - activesupport-3.0.0.beta3/lib/active_support/callbacks.rb:88 — Szymon Jeż <redmine@...>

Bug #3288: Segmentation fault - activesupport-3.0.0.beta3/lib/active_support/callbacks.rb:88

10 messages 2010/05/13

[#30358] tk doesn't startup well in doze — Roger Pack <rogerdpack2@...>

Currently with 1.9.x and tk 8.5,the following occurs

12 messages 2010/05/22

[ruby-core:30275] [Backport #3304] Bug in BigDecimal#to_f

From: Reuven Lerner <redmine@...>
Date: 2010-05-17 11:25:42 UTC
List: ruby-core #30275
Backport #3304: Bug in BigDecimal#to_f
http://redmine.ruby-lang.org/issues/show/3304

Author: Reuven Lerner
Status: Open, Priority: Normal

I'm using ruby 1.8.7 (2009-06-08 patchlevel 173) [universal-darwin10.0], from OS X Snow Leopard.    I am using BigDecimal in a project that requires a large number
of significant figures after the decimal point.  I know that there are issues using floats for exact math, but I think that I have discovered something surprising 
even when you take that into consideration:

In IRB:

>> require 'bigdecimal'
=> true
>> number = BigDecimal.new('2.50000')
=> #<BigDecimal:102ba0128,'0.25E1',8(12)>
>> number.to_f
=> 2.5
>> number += BigDecimal.new('1000000')
=> #<BigDecimal:102b8d0f0,'0.10025E7',12(20)>
>> number.to_f
=> 1002500.0
>> number.to_s("F").to_f
=> 1000002.5

Am I missing something?  I'd like to think that this is my mistake, but these results definitely violated the Principle of Least Surprise!

Reuven


----------------------------------------
http://redmine.ruby-lang.org

In This Thread

Prev Next