change the output_format

Before:printf('%f\n',p);
After:printf('%.12f\n',p);