Welcome to MNUG.net

 

 

The Memphis .NET User Group (Memphis, Tennessee) is an open and independent forum for area technologists that provides structured, peer-based educational support and professional networking to its members.

MNUG is registered with INETA

Memphis .Net User Group

The mission of the Memphis .Net User Group is to educate, evangelize and inform the community about the direction in which Microsoft .NET, Microsoft SQL Server, and related technologies and how developers and architects of various, yet intersecting disciplines can start to prepare for what is ahead while serving the community through knowledge sharing and evangelism of current technologies.

Monthly meetings are usually held on the fourth Thursday of the month and attendance is free. Our meeting location currently varies. Meetings start at 6:00 p.m. with pizza and drinks provided by Robert Half Technology, followed by the presentation starting around 6:30 p.m.

Other Memphis web sites of potential interest:

1) Memphis Technology Foundation - Is a group of people in Memphis with a diverse interest in Technology. We are user group leaders and participants interested in learning and growing our community.

2) Memphis Technology User Groups - Memphis Technology User Groups is a community calendar for technology user groups in the Memphis area.


Upcoming Meetings

November Meeting

Due to the Thanksgiving holiday, there will be NO Memphis .NET User group meeting in November. 



--------------------------------------------------------------------------------------------------------------------------

On another note, I have been working with the Microsoft .NET framework since around 2004.  The other day I learned something new.  I was using the Math.Round method, and I noticed that it was not working the way that I expected. Here is what I mean.  I had a value of .3650, and I was rounding it to two decimal places Math.Round(.3650,2).  I was expecting the result to be .37, but instead it returned .36.  What's going on? 

After some research, I found that the Math.Round method, by default, follows the round-to-even rule or bankers rounding:

"With the round-to-even rule, when the remainder at the rounding position is .5, that number is rounded up when the number before it is odd, and rounded down when the number before it is even. For example, the number 6.5, using the round-to-even rule, would round down to the even number 6.0, while the number 7.5 would round up to the even number 8.0 -- hence the name round-to-even rule." 

So in my case, since the number I was rounding to was even, 6 (.3650), it rounded down to .36.  Not what I wanted.  The fix, the Math.Round method comes with an overload that takes a MidpointRounding value. 

Using the overload Math.Round(.3650,2,MidPointRounding.AwayFromZero), my code returned .37, which was what I needed.

Why does the Math.Round method default to Bankers Rounding?  Apparently, it is following the IEEE 754 standard.

Here are links I found and used to gather my information.

http://msdn.microsoft.com/en-us/library/System.Math.Round(v=vs.110).aspx#Round3_Example

http://stackoverflow.com/questions/977796/why-does-math-round2-5-return-2-instead-of-3-in-c

http://www.mortgageloancalculating.com/bankers-rounding.html

 

Gold Sponsors

Robert Half Technology
           
telerik
Pluralsight 

 
 Wrox
 developer tools

Tech Community Events (www.meetup.com/memphis-technology-user-groups/)

     
Event StartTitle
12/24/2014 11:30 AM Recurring Event: until 12/30/2020 (total 481 events) Memphis Tech Lunch #memtech
12/25/2014 6:00 PM High Priority Recurring Event: until 11/26/2020 (total 109 events) MNUG Meeting
12/31/2014 11:30 AM Recurring Event: until 12/30/2020 (total 481 events) Memphis Tech Lunch #memtech
1/7/2015 11:30 AM Recurring Event: until 12/30/2020 (total 481 events) Memphis Tech Lunch #memtech
1/14/2015 11:30 AM Recurring Event: until 12/30/2020 (total 481 events) Memphis Tech Lunch #memtech