|
|
back to boardWhat accuracy for output? How many digits after decimal point? Re: What accuracy for output? How many digits after decimal point? The answer should be with 10^-2 accuracy. But keep in mind that we do not accept extra zeroes. 1 != 1.0 != 1.00 1.1 != 1.10 Re: What accuracy for output? How many digits after decimal point? But what does 'extra zeros' mean? For example, if the accurate value is 6.0004, shall I output 6 or 6.00? And what if 6.000000000000004, which is just floating-point error? Re: What accuracy for output? How many digits after decimal point? Just 6, in both cases. Re: What accuracy for output? How many digits after decimal point? for C++, it would be a troublesome cout<<setiosflags(ios::fixed)<<setprecision(2)<<result<<endl; the program above will not work so I have to write a void to do it myself. |
|
|