3 ms·
The code below works for me #define PI1 3.141592653589793115997963468544185161590576171875 double pi1 = PI1; #define PI2 3.1415926535897932384626433832795028
by stagger87 10y ago
The code below works for me
#define PI1 3.141592653589793115997963468544185161590576171875
double pi1 = PI1;
#define PI2 3.14159265358979323846264338327950288
double pi2 = PI2;
assert(pi1 == pi2);
(edit: or even 3.14159265358979323846)
- pklausler 10y agoYour PI2 rounds to PI1 under the rounding mode used at compilation time. Print it out with "%50.48f" (or FORMAT(F50.48)) and you'll see PI1. But PI1 is independent of rounding mode.
- stagger87 10y agoSure. I thought you were implying more than that. When you called it a bug I thought you were implying that the use of one over another would alter the output of a program. My bad.