开发者

what exactly precision of 15 digits mean for float data type?

开发者 https://www.devze.com 2023-03-16 00:37 出处:网络
As per the float and real (Transact-SQL) float is an approximate data type. But also in the same article it is being mentioned that float has precision of 15 digits.

As per the float and real (Transact-SQL) float is an approximate data type.

But also in the same article it is being mentioned that float has precision of 15 digits.

Wha开发者_如何学编程t exactly it mean by Precision of 15 digits?


It means that the first 15 digits are approximately correct. Thanks to IEEE 754 there are many numbers that can't be exactly represented, but you can be sure that the first 15 digits are very close.


Your numbers are exact with a precision of 15 digits. That means if you calculate something and store the outcome as a float, you can be sure the first 15 digits are the right result. After that they might (and usually are) not.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号