tag:blogger.com,1999:blog-11168006.post5409041042717931609..comments2024-02-15T22:31:01.027-07:00Comments on Business SOA: Redirects and the lack of precisionSteve Joneshttp://www.blogger.com/profile/18324989580856894788noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-11168006.post-7188348152731450572008-10-22T11:14:00.000-07:002008-10-22T11:14:00.000-07:00Additional references on the issue of using binary...Additional references on the issue of using binary floating point arithmetic and expecting accuracy:<BR/><BR/>http://www2.hursley.ibm.com/decimal/<BR/>http://docs.sun.com/source/806-3568/ncg_goldberg.html<BR/><BR/>http://en.wikipedia.org/wiki/Floating_point<BR/><BR/>"...naive use of floating point arithmetic can lead to many problems... Floating point arithmetic is at its best when it is simply Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11168006.post-86388130914615683342008-10-22T10:53:00.000-07:002008-10-22T10:53:00.000-07:00This is not a Java problem. It is a binary arithme...This is not a Java problem. It is a binary arithmetic problem, common to all language environments. If you need accuracy, avoid using float and double. The answers you're seeing are "precise" but not "accurate."<BR/><BR/>"Most terminating decimal fractions cannot be exactly represented as terminating binary fractions." <BR/>-- Joe Darcy, Java Floating-Point Czar <BR/><BR/>http://mindprod.com/Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11168006.post-48701964636344930162008-10-17T14:35:00.000-07:002008-10-17T14:35:00.000-07:00python:>>> from decimal import Decimal>...python:<BR/>>>> from decimal import Decimal<BR/>>>> Decimal("20.5")/5<BR/>Decimal("4.1")<BR/>>>> print Decimal("20.5")/5<BR/>4.1Anonymousnoreply@blogger.com