user=> (- (new Double "1786.28") (read-string "1786.28"))
0.0
Following uip on what Hugo said, modifying your code to a double
returns the following.
On Nov 27, 1:32 pm, "Hugo Duncan"
wrote:
> On Fri, 27 Nov 2009 14:50:27 -0500, Nathan Cunningham
>
> wrote:
> > Apparently there are cases whe
On Nov 27, 9:32 pm, "Hugo Duncan"
wrote:
> read-string returns a Double for me...
Yeah:
user> (class (read-string "1786.28"))
java.lang.Double
user> (- (new Double "1786.28") (read-string "1786.28"))
0.0
--
You received this message because you are subscribed to the Google
Groups "Clojure" gro
On Fri, 27 Nov 2009 14:50:27 -0500, Nathan Cunningham
wrote:
> Apparently there are cases where read will return a slightly different
> float then the Float constructor will. For example:
>
> (- (new Float "1786.28") (read-string "1786.28"))
> 2.929687502728484E-5
read-string returns a Double
I was working on a system that used the reader / pprint to load and
save data too and from the disk and I ran into a strange issue when I
reloaded my work from a JTable
Apparently there are cases where read will return a slightly different
float then the Float constructor will. For example:
(- (n