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]
# 1

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).

JoachimSauera at 2007-7-15 14:25:39 > top of Java-index,Core,Monitoring & Management...
# 2
Thanks a lot
tamria at 2007-7-15 14:25:39 > top of Java-index,Core,Monitoring & Management...