Bugs item #9261, was opened at 2007-03-13 17:32
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=9261&group_id=426

Category: Standard Library
Group: 1.8.5
Status: Open
Resolution: None
Priority: 3
Submitted By: Mark Somerville (spakman)
Assigned to: Nobody (None)
Summary: BigDecimal initialisation bug

Initial Comment:
Seems like the BigDecimal intialisation code has a bug:

This positive value is interpretted as I'd expect:

>> BigDecimal.new(".31").to_s
=> "0.31"

But this negative one isn't:

>> BigDecimal.new("-.31").to_s
=> "0.31"

Cheers,

Mark

----------------------------------------------------------------------

Comment By: Benjamin Atkin (benatkin)
Date: 2007-03-24 19:08

Message:
If you have a leading zero, it works:

irb(main):005:0> BigDecimal.new("-0.31").to_s
=> "-0.31E0"

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=9261&group_id=426