Joined: 30 Nov 2013 Posts: 859 Location: The Universe
I have no idea how DB2 stores floating point values. However, what you are describing is generic to floating point arithmetic in computers, and converting floating point values from decimal to binary and back to decimal. In general, it is not possible to convert something like 99.999 to an exact binary representation, and convert it back to 99.9990000. There are some exceptions. 99.50000 will convert exactly, and it should convert back to 99.5000000. However there is no “exact” conversion for most decimal fractions.
Joined: 06 Jun 2008 Posts: 8560 Location: Dubuque, Iowa, USA
Want to know if this is a limitation with DB2 FLOAT and if it can be handled in any way.
This is because of how computers handle floating point, as otherwise stated, and there is nothing you can do about it. For example, 0.1 is an infinite repeating fraction in binary and hence CANNOT be precisely represented in floating point. If the issue is important, don't use floating point.