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.
精彩评论