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 - 11 years ago
reply permalink
Oscar - 11 years 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 - 11 years ago
C#
reply permalink
Ben - 11 years ago
Actually i like this better
reply permalink