On Tue, Jan 24, 2012 at 12:58 PM, Florian Gilcher <flo / andersground.net>wrote:
...

> As for the discussion: this comes up every 6 months and the horse is
> already
> dead in the first mail. While I can certainly understand the frustration
> with
> float, the decision is made. Reverting it would mean touching every piece
> of
> software that does statistics. And in contrast to popular belief, there is
> quite a lot of it out there. I know that at least 10 of my reporting
> scripts
> running at several clients offices would break, which would be
> unacceptable for
> me (expecially, because float is the correct datatype there).
> Changing such a primitive in a language is reckless.
>


Ha, just discovering the 'to_d' function in 'bigdecimal/util'

It's actually very close to what I wanted (15.78D):

$ irb
1.9.3p0 :001 > require 'bigdecimal'
 => true
1.9.3p0 :002 > require 'bigdecimal/util'
 => true
1.9.3p0 :003 > a = "15.78".to_d
 => #<BigDecimal:8b2d9e8,'0.1578E2',18(18)>
1.9.3p0 :004 > b = 2.to_d
 => #<BigDecimal:8b2a810,'0.2E1',9(36)>
1.9.3p0 :005 > a/b == 7.89.to_d
 => true
1.9.3p0 :006 > 1.234567890123.to_d
 => #<BigDecimal:8ba49bc,'0.1234567890 123E1',27(45)>

I'm all set here :-)

Peter