在 iOS 4.3 模拟器上,以下代码返回一个非常小的数字:1e-700
在 GCC 4.2 上,但在 LLVM-GCC 4.2 上按预期工作。有任何想法吗?
NSDate *selectedDate = self.datepicker.date; // guaranteed to be before now
NSTimeInterval interval = [nowDate timeIntervalSinceDate:selectedDate];
这些值随每次运行而变化,但这里是一组输出示例
选定日期:1981-06-02 16:27:34 +0000
现在日期:2011-08-03 05:18:36 +0000
间隔:5.489011535689859e-277
[nowDate timeIntervalSinceDate:selectedDate]
在 GDB 中运行:(952001462.97236204
这是我的预期值)