Completed
Details
Details
Assignee
Unassigned
UnassignedReporter
import
importApproval
Ok
Patch
Code and Test
Priority
Affects versions
Fix versions
Created November 20, 2011 at 8:47 AM
Updated May 19, 2012 at 2:37 AM
Resolved May 19, 2012 at 2:37 AM
Let's see the following scenario:
vdim@home:~/clojure$ git log -1
commit ba930d95fc3a4a78c5bd6756ea483c9dac681618
Author: Rich Hickey <richhickey@gmail.com>
Date: Sun Oct 30 10:44:55 2011 -0400
inline equiv in variadic =
vdim@home:~/clojure$ rlwrap java -cp clojure-1.4.0-master-SNAPSHOT.jar clojure.main
Clojure 1.4.0-master-SNAPSHOT
user=> (use 'clojure.pprint)
nil
user=> (cl-format nil "~12,10F" 1.00000000074)
"1.0000000007"
user=> (cl-format nil "~12,10F" 1.00000000076)
NumberFormatException For input string: "10000000007" java.lang.NumberFormatException.forInputString (NumberFormatException.java:65)
user=>
The exception is caused from round-str function (cl-format.clj) where
my number (100000000076) is coerced to an Integer (see line with Integer/valueOf code
into this function).
Is this normal behaviour?
See patch with tests and my suggestion for solving this problem.