Wrong answer in xflmoon
|
|
|
Question / Problem
|
Symptom:
There is a bug in the system 'cc' compiler, seen in some versions of DEC Ultrix, which will show up in xflmoon. A simpler version can be demonstrated in the following small program:
#include < stdio.h >
main() {
int n = 10;
n = n + ((int) (-0.99));
printf("%d\n",n);
n = 10;
n += ((int) (-0.99));
printf("%d\n",n);
}
This will produce output of 10 and 9, instead of the expected 10 10.
|
Solution
|
Solution:
You'll have to get an updated compiler version.
|
Applies to |
|
C
|
Rank It |
|