trouble with double!
I have jdk1.5. use double and sometimes something strange happens. Forexample when I have variable double d=4.00, java in db(ms.sql server2000) writes 3.9999999, or when d=2.45 ,in db writed 2.449999999.it happens sometimes,not everytimes.why? what is wrong? is it java's
[298 byte] By [
tamria] at [2007-10-3 11:51:34]

That's because some finite decimal numbers can not be represented exactly in binary floating point numbers: [url=http://docs.sun.com/source/806-3568/ncg_goldberg.html]What Every Computer Scientist Should Know About Floating-Point Arithmetic[/url] (hard to read & grasp, but definitely worth it).