OT : Java

Andre Landwehr andre.landwehr at gmx.net
Tue Apr 23 15:39:04 CEST 2002


On Tue, Apr 23, 2002 at 03:22:48PM +0200, jan.krueger at in.tum.de wrote:
> ich programmiere gerade einiges in Java ...
> und bin dabei auf etwas wirklich komisches gestoßen.
> (...)
> 0.0 0.1 0.2 0.30000000000000004 0.4 0.5 0.6 
> 0.7 0.799999999999999 0.8999999999999999 
> 0.9999999999999999
> 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.70000005 
> 0.8000001 0.9000001

ich denke mal das liegt noch nicht mal an Java sondern ist ein
programmiersprachenübergreifendes Feature ;-)
Das wird damit zu tun haben, daß der Rechner nur eine begrenzte
Genauigkeit hat und durch die interne Darstellung sind halt
bestimmte scheinbar einfach Zahlen nicht genauer abzubilden als
du es in deinem Programm siehst.

Andre

--
 /"\
 \ /
  X  ASCII Ribbon campaign against HTML E-Mail
 / \

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://lug-owl.de/pipermail/linux/attachments/20020423/c7bdaff5/attachment.sig>


More information about the Linux mailing list