Let's do a rounding problem for problem #150. Today's objective is to implement your own rounding function (or method) for floating point numbers. That means not using the built in rounding methods of the language of your choice. Your function should have a flag to round down, round normally (at .5), and round up.
Comments:
Anonymous - 10 years, 2 months ago
reply permalink
Oscar - 10 years, 2 months ago
I'm not aware of a better way of truncating the number than just converting it to an int, and I'm not sure if it's allowed in the exercise. Feedback appreciated.
reply permalink
Ben - 10 years, 2 months ago
C#
reply permalink
Ben - 10 years, 2 months ago
Actually i like this better
reply permalink