SQL Server弥补浮游物额外的精度? [英] SQL Server makes up extra precision for floats?
问题描述
我有一个文本文件w /以下坐标:
41.88694340165634 -87.60841369628906
这到SQL Server Mgmt Studio表视图,结果如下:
pre $ 41.886943401656339 -87.608413696289062
我在做梦吗?这是怎么回事?
我是从记事本上粘贴的,而且是原始文本。同样的问题,如果我直接键入字符。
从哪里获得额外的精度?
根据Books-On-Line:
浮点数:与浮点数一起使用的近似数字数据类型点数字数据。 浮点数据近似;因此,数据类型范围中的所有值都不能完全表示。
重点是我的。
Precision loss is one thing, but precision gain???
I have a text file w/ the following coordinates:
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?
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.
这篇关于SQL Server弥补浮游物额外的精度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!