SQL Server makes up extra precision for floats?
Precision loss is one thing, but precision gain???
I have a text file w/ the following coordinates:
When I paste this into SQL Server Mgmt Studio table view, it results in this:
Am I dreaming? How is this possible?
I’m pasting from notepad, and it’s raw text. Same problem if I type the characters directly.
Where does sql server get the extra precision from?
3 Solutions collect form web for “SQL Server makes up extra precision for floats?”
According to Books-On-Line:
Float: Approximate-number data types for use with floating point numeric data. Floating point data is approximate; therefore, not all values in the data type range can be represented exactly.
It’s not adding precision, it’s just rounding it to the nearest IEEE floating point representation. When you convert that back to decimal, it only LOOKS like it gained precision.
I haven’t personally seen this, but it might just be that the SQL server management studio shows the “representation” of the float i.e. how the value would be stored in the db. Remember that floats are all approximate anyway.