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:

  • need help with some stored procedure error
  • How to drop a list of SQL Server tables, ignoring constraints?
  • SQL Joining data when it is grouped and has different frequency
  • INSERT with the same data in different tables
  • Next Booking Record with Function and table
  • SQL Solve a Function with a While Loop
  • 41.88694340165634   -87.60841369628906

    When I paste this into SQL Server Mgmt Studio table view, it results in this:

    41.886943401656339  -87.608413696289062

    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.

    Emphasis mine.

    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.

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.