问题描述
// MS-Bug#999,995(剩下5个错误: - ):
const double d = DBL_MIN;
double v00 = 0.0;
bool f00 = v00 d;
double v01 = 0.1;
bool f01 = v01 d ;
为f00错误地给出''false'':-)
错误在您的代码中。 DBL_MIN是一个最小的正值。
Alex
进一步的分析显示它与DBL_MIN没什么关系
但是值为ZERO!
即。 MS编译器在FP操作中不正确地处理值0.
或Adem24 bug#3562?
d大于0:或许它有助于阅读文档?
f00应该是真的。
/ Peter
// MS-Bug # 999,995 (5 left for 1 million bugs :-) :
const double d = DBL_MIN;
double v00 = 0.0;
bool f00 = v00 d;
double v01 = 0.1;
bool f01 = v01 d;
gives wrongly ''false'' for f00... :-)
The bug is in your code. DBL_MIN is a minimal positive value.
Alex
Further analysis shows that it has nothing todo with the DBL_MIN
but the value ZERO !
Ie. the MS compiler treats the value 0 not correctly in FP ops.
Or Adem24 bug# 3562?
d is bigger than 0: perhaps it would help to read the documentation?
f00 should be true.
/Peter
这篇关于MS C ++编译器出现错误的FP错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!