Displaying 1 result from an estimated 1 matches for "455f2000".
2017 Mar 21
3
[question] с-double: 35.7 * 100 vs 3570.0
...b != a) return 1;
return 0;
}
It returns 1 due to:
40abe400 00000000 //a = 3570.0
40abe400 00000001 //b = 35.7 * 100;
gcc do the same thing, so I think it's ok but why?
For floats:
float a = 3570.0;
float b = 35.7 * 100;
int main ()
{
if (b != a) return 1;
return 0;
}
It returns 0...
455f2000 //a = 3570.0
455f2000 //b = 35.7 * 100;
I will be grateful to get any explanations.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170321/60d8fef3/attachment.html>