Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
System.Math.Round
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Divers
Thread ID:
01135065
Message ID:
01135078
Vues:
13
>I would say, they in VB.NET do not follow the math rules. As in Net Help:
>
>*----------------------------
>The following code example demonstrates rounding to nearest.
>[Visual Basic]
>Math.Round(3.44, 1) 'Returns 3.4.
>Math.Round(3.45, 1) 'Returns 3.4.
>Math.Round(3.46, 1) 'Returns 3.5.
>
>If d is halfway between two whole numbers, one of which by definition is even and the other odd, then the even number is returned.
>
>The behavior of this method follows IEEE Standard 754, section 4. This kind of rounding is sometimes called rounding to nearest, or banker's rounding.
>
>"rounding toward zero"
>*------------------------------------------
>
>
>However, rounding should go up in cases like 3.45,or 10.125 in pure math. Sure in banking they want to trick you and round you money to zero.
>

Interesting!

Thanks.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform