DateTime precision vs accuracy?

前端 未结 2 1965
野性不改
野性不改 2021-01-15 03:13

Eric Lippert wrote an article about DateTime. Jon Skeet commented on his article with

I don\'t have a problem with DateTime having too much p

2条回答
  •  甜味超标
    2021-01-15 03:44

    The problem that arises with having that much precision is of course that it is very easy to assume that a given value is as accurate as it is precise. But that’s not warranted at all! I can represent my height in a double-precision floating point number as 1.799992352094 metres; though precise to a trillionth of a metre, it’s only accurate to about a hundredth of a metre because I do not have a device which can actually measure my height to a trillionth of a meter, or even a thousandth of a metre. There is way more precision than accuracy here.

    Source

提交回复
热议问题