#include int main() { double fract=0; int tmp; //scanf(\"%lf\",&fract); fract=0.312; printf(\"%lf\",fract); printf(\"\\n
So you multiplied 0.3119999999999999999895916591441391574335284531116485595703125 by 1000 and truncated it and got 311? I don't see where the problem is.