+ 1
Anyone know why?
Console.WriteLine(Math.Round(5.5));// 6 But Console.WriteLine(Math.Round(6.5));// 6
2 Antworten
+ 3
I am not sure why you getting 5 and 6 as output.
In round function if floating point value is greater than .5 then it will return next higher integer, but if it is less than .5 then it will return nearest lower integer.
When it is exactly .5, it will always give next integer