...
This code attempts to reduce a floating point number to a denormalized value and then restore the value. This operation is very imprecise.
Code Block | ||||
---|---|---|---|---|
| ||||
#include <stdio.h> float x = 1/3.0; printf("Original : %e\n", x); x = x * 7e-45; printf("Denormalized? : %e\n", x); x = x / 7e-45; printf("Restored : %e\n", x); |
...
Don't produce code that could use denormalized numbers. If floats are producing denormalized numbers, use doubles instead.
Code Block | ||||
---|---|---|---|---|
| ||||
#include <stdio.h> double x = 1/3.0; printf("Original : %e\n", x); x = x * 7e-45; printf("Denormalized? : %e\n", x); x = x / 7e-45; printf("Restored : %e\n", x); |
...