Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mathematical rounding
Message
De
31/01/2005 17:29:21
 
 
À
31/01/2005 16:56:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00982326
Message ID:
00982507
Vues:
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! ;)
>
>Result should be 12.4
>
>Here's why according to my theory of "equality for the digits"
>
>12.340, 12.341, 12.342, 12.343, 12.344 all rounded to 12.3
>12,345, 12.346, 12.347, 12.349, 12.349 all rounced to 12.4
>
>That way 5 are rounded up and 5 are rounded down. So rounding is fair for the digits.

So, what is then the consequence for your code? Or don't you ever use ROUND() ?

>If the result would be what you thought
>
>12.340, 12.341, 12.342, 12.343, 12.344, 12.345 rounded to 12.3
>12.346, 12.347, 12.348, 12.349 rounded to 12.4
>
>Now with this you see that it's not fair for the digits. They are not treated equally.
>
>I thought that this reply based on respecting the digits was necessary 8-D
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform