1.math.round: Four six into the five to take even
Reference content Math.Round (0.0)//0
Math.Round (0.1)//0
Math.Round (0.2)//0
Math.Round (0.3)//0
Math.Round (0.4)//0
Math.Round (0.5)//0
Math.Round (0.6)//1
Math.Round (0.7)//1
Math.Round (0.8)//1
Math.Round (0.9)//1
Note: For 1.5, the result is 2 because you want to return an even number.
2.math.ceiling: As long as there are decimals plus 1
Reference content math.ceiling (0.0)//0
Math.ceiling (0.1)//1
Math.ceiling (0.2)//1
Math.ceiling (0.3)//1
Math.ceiling (0.4)//1
Math.ceiling (0.5)//1
Math.ceiling (0.6)//1
Math.ceiling (0.7)//1
Math.ceiling (0.8)//1
Math.ceiling (0.9)//1
Description: For example, it is useful to calculate the number of pages in a paging algorithm.
3.math.floor: Always give away decimals
Reference content Math.floor (0.0)//0
Math.floor (0.1)//0
Math.floor (0.2)//0
Math.floor (0.3)//0
Math.floor (0.4)//0
Math.floor (0.5)//0
Math.floor (0.6)//0
Math.floor (0.7)//0
Math.floor (0.8)//0
Math.floor (0.9)//0
C # Rounding functions Math.Round, math.ceiling, and Math.floor