Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mathematical rounding
Message
From
31/01/2005 17:28:13
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00982326
Message ID:
00982506
Views:
25
>Hi to all,
>
>Here is the controversy:
12.345   -> 12.3
>         -> 12.4
In my opinion, the first one (12.3) is the correct 'mathematical rounding' (to 1 decimal here). However, some colleagues say the second one is correct.
>
>Please, tell me that I'm correct! ;)

Normally you want to round to the closest. 12.345 is closer to 12.3 than to 12.4 - calculate the difference to see whether this is true.

The only place where there can be controversy, and where there is really no "correct" method, but only agreements, is when the number to be rounded is exactly in the middle. 15.85 is just as close to 15.8 than to 15.9. The principle usually used in computing is to always round up in this case, but several other agreements exist.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform