Hi,
i want the double value rounded up to the nearest 0.05
e.g., if input= 10.37 then output= 10.35
if input=10.33 then output=10.35
can anybody help for this logic ?
Thanks
Andrey Kozhanov
Ranch Hand
Joined: Mar 12, 2010
Posts: 79
posted
0
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32694
4
posted
1
anu sav wrote: . . .
i want the double value rounded up to the nearest 0.05
e.g., if input= 10.37 then output= 10.35 . . .
That is not rounded up.
Remember all floating-point arithmetic, including rounding, is subject to errors of imprecision.