Life as a Software Developer

Wednesday, December 12, 2012

Math.Round - Midpoint Rounding Enumeration

Math.Round in c# might not do what you think it does.

http://msdn.microsoft.com/en-us/library/system.midpointrounding.aspx

If you don't specify the enumeration above, it defaults to .5 goes DOWN:


4.5 --> 4 

http://msdn.microsoft.com/en-us/library/3s2d3xkk.aspx

Interesting Article RE bankers rounding:

http://www.xbeat.net/vbspeed/i_BankersRounding.htm


Posted by Unknown at 9:49 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2013 (2)
    • ►  January (2)
  • ▼  2012 (56)
    • ▼  December (14)
      • Some useful SharePoint 2013 Installation Notes
      • Installing Active Directory on Server 2012...
      • Installing SQL 2012 on Server 2012? .Net 3.5 is r...
      • What is new in Team Foundation 2012.
      • Dependency injection
      • 2010 Flash Crash - Crash of May6, 2010, 2:45... A...
      • I know this really smart dude - he studied Wavelet...
      • Party Resolution, Schema Discovery, and Authorizat...
      • Learning AWK - old timers PowerShell...
      • Scrum Process for TFS 2010
      • WF 4.5 - Windows Workflow Foundation 4.5
      • Cool stuff Enterprise Library 5.0 – May 2011...
      • Word 2010 Page Break
      • Math.Round - Midpoint Rounding Enumeration
    • ►  November (21)
    • ►  October (21)

About Me

Unknown
View my complete profile
Awesome Inc. theme. Powered by Blogger.