Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
System.Math.Round
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01135065
Message ID:
01135078
Views:
12
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform