Practice ยท 3 of 4
Truncate, then round
CHALLENGE
Difficulty: beginner+25 XP
Implement two functions: static int Truncate(double d) returning the integer part, and static int Round(double d) returning d rounded to nearest (midpoint away from zero). Use casts and Math.Round deliberately.
Press Submit to check your solution.
Back to lesson: Practice: Types under pressure