Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mathematical rounding
Message
From
31/01/2005 17:38:32
 
 
To
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:
00982514
Views:
23
>>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.

Agree.

>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.

I agree here that other agreements exist. For example to round .x5 up in case x is uneven and down if x is even, something like that. (I just read about this in one of my son's textbooks on floating point measurements, 1st year physics.)

But on purpose I referred to mathematical rounding. This afternoon (ET) I searched on the internet for the definition of this method, that we all probably learned in school. Google is phantastic, but nevertheless I had trouble finding an official definition of this 'obvious' thing.
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Reply
Map
View

Click here to load this message in the networking platform