BigDecimal#to_f always returns 0.0 for large precisions
-------------------------------------------------------
Key: JRUBY-5190
URL: http://jira.codehaus.org/browse/JRUBY-5190
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.5.3, JRuby 1.3.1
Environment: Mac OS X 10.6
Reporter: Hans-Georg Höhne
Fix For: JRuby 1.2
{{jruby -ve 'require "bigdecimal"; n = BigDecimal("1").div(BigDecimal("3"),
307); p n, n.to_f; n = BigDecimal("1").div(BigDecimal("3") , 308); p n,
n.to_f'}}
{{jruby 1.2.0 (ruby 1.8.6 patchlevel 287) (2009-03-16 rev 9419) [x86_64-java]
#<BigDecimal:19fac852,'0.3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333E0',307(308)>
0.333333333333333
#<BigDecimal:46da3772,'0.33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333E0',308(312)>
0.333333333333333
}}
{{jruby 1.3.1 (ruby 1.8.6p287) (2009-06-15 2fd6c3d) (Java HotSpot(TM) 64-Bit
Server VM 1.6.0_22) [x86_64-java]
#<BigDecimal:418a9fc8,'0.3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333E0',307(308)>
0.333333333333333
#<BigDecimal:558041e0,'0.33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333E0',308(312)>
0.0
}}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email