Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / January 2006

Tip: Looking for answers? Try searching our database.

Obscure rounding in .NET

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
eXavier - 25 Jan 2006 15:00 GMT
Hello,
we just figured out that there is some obscure rounding algorithm
implemented in .NET framework (e.g. 0.05 rounded to 1 decimal digit is 0.0
instead of 0.1). Although the behaviour is described in MSDN, it is so
unexpected that we didn't noticed it and we used it in an application. In
financial application. What a faux pass! When we wanted to fix this, we were
looking for some setting to switch to standard rounding but surprisingly we
found nothing. This is very strange - rounding is quite common operation. Is
there another library for standard rounding? What is the "rounding toward
even" algorithm good for? And why it is implemented in standard library
instead of normal rounding algorithm?

Thanks,
eXavier
Christopher Reed - 25 Jan 2006 20:33 GMT
In the .NET 2.0 Framework, it appears that these issues have been addressed.
You might look at the MSDN documentation for .NET 2.0 for more information.
Signature

Christopher A. Reed
"The oxen are slow, but the earth is patient."

> Hello,
> we just figured out that there is some obscure rounding algorithm
[quoted text clipped - 13 lines]
> Thanks,
> eXavier

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.