Details
-
Type:
Defect
-
Status:
Closed
-
Resolution: Completed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
Reported by jbondeson, Jan 30, 2009 Originally discussed here: http://groups.google.com/group/clojure/browse_thread/thread/1f8029b8556ce851/9b7538b192490097?lnk=gst&q=ratio#9b7538b192490097 The current implementation of conversion of clojure.lang.Ratio class to a fixed precision floating point value is not what one would expect. For example: user> (double (/ (expt 2 1024) 3)) Infinity when in fact it should return: 5.992310449541053E307 Attached is the fix for the Ratio class to allow for the proper conversion to a double or float by using a BigDecimal division with a fixed precision. Additionally, I sent in my CA on Monday, so it should be there anytime now. ratio-conv.diff 1.0 KB Download Comment 1 by richhickey, Feb 09, 2009 patch applied - svn 1256 - thanks! Status: Fixed
Converted from http://www.assembla.com/spaces/clojure/tickets/63
Attachments:
ratio-conv.diff - https://www.assembla.com/spaces/clojure/documents/ckgKFGw3ur3R14eJe5aVNr/download/ckgKFGw3ur3R14eJe5aVNr