4 ms·
The round-tripping behavior is certainly cool, but my favorite float-fact is still this one: double pi = 3.14159265358979323846; printf("pi = %.33f\n + %.33f
by brucedawson 12y ago
The round-tripping behavior is certainly cool, but my favorite float-fact is still this one:
double pi = 3.14159265358979323846;
printf("pi = %.33f\n + %.33f\n", pi, sin(pi));
sin(double(pi)) is equal to the error in the double(pi) constant. If you manually add the two you can easily get pi to about 34 digits. Useless, but cool. I discuss this in more detail here:
http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ http://randomascii.wordpress.com/2012/02/25/comparing-floati...
- forrestthewoods 12y agoif I didn't encounter it personally it can't possibly be my favorite