以下代码产生显示的输出,我很困惑......我使用的是英特尔编译器版本 2013 beta update 2 /opt/intel/composer_xe_2013.0.030/bin/intel64/icpc
:
// all good
int64_t fops_count1 = 719508467815;
long double fops_count2 = boost::static_cast<long double>(fops_count1);
printf("%" PRIu64 "\n", fops_count1); // OK outputs 719508467815
printf("%Le\n", fops_count2); // OK outputs 7.195085e+11
// bad! why this?
int64_t fops_count1 = 18446743496931269238;
long double fops_count2 = boost::static_cast<long double>(fops_count1);
printf("%" PRIu64 "\n", fops_count1); // OK outputs 18446743496931269238
printf("%Le\n", fops_count2); // FAIL outputs -5.767783e+11 <<<<<<<<<<<<<<<<< WHY?