Sunday, September 29, 2013

Re: Decimals acting wierd : 5.3 * 3 = 15.899999999999999

On 09/29/2013 03:20 AM, Martones wrote:
> Hey guys,
>
> I had this problem hounting me since quite a while. I'm using double
> types in the equation above and I have this wierd precision result :
> 5.3 * 3 = 15.899999999999999
>
> This is not the first time at all and I already saw this with floats /
> without multiplication and so on. Before I spend few hours figuring
> out some test cases, can anyone give me any directions of where and
> what to search ? :)

If you know that your floats will be of a certain precision: scale,
multiply, divide. Take advantage of what you know about the problem
domain to your advantage


>
> Many thanks everyone !
>
> Ludovit
> --
> You received this message because you are subscribed to the Google
> Groups "Google Web Toolkit" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to google-web-toolkit+unsubscribe@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at http://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment