Originally Posted by felgall
It looks like it is the fraction part that is always wrong - possibly because floating point numbers are never exact when it comes to number bases other than 2. Have you considered multiplying by 1e10 first before converting and then shifting the decimal point back to the right place afterwards?
When i tried that i got
p_60133.cpp: In function ‘int main()’:
p_60133.cpp:17:16: warning: overflow in implicit constant conversion [-Woverflow]
and the same results.