On 10/15/14, 8:11 PM, Elena wrote:Hi,every one!How can I realize mathematical rounding (not banking) for Double in D0.4 -> 0 0.5 -> 1 1.5 -> 2 2.5 -> 3 3.5 -> 4 ?Thank you.Add 0.5 and then cast to integral. -- Andrei
This would be the "round half up" mode that produce 0 for -0.5: floor(x+0.5) Whereas "round nearest" should produce -1 for -0.5: floor(abs(x)+0.5)*sgn(x)
