开发者

Problem with NSNumber (double values are off by 1)

I'm getting the following output and I've no idea why!? The resulting number is off by 1.

I thought 开发者_JAVA技巧that double's can handle massive numbers? I'm sure I'm not understanding something correctly! Any help would be greatly appreciated.

(gdb) print (double) [[NSNumber numberWithDouble:9606977671929857.0] doubleValue]
$13 = 9606977671929856

Many thanks!


You've exhausted the precision of the double-precision floating point type, which only has room for about 14 significant digits in decimal notation.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜