Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8260311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:04:18+00:00 2026-06-08T03:04:18+00:00

Looking at the msdn documentation for Convert.ToInt32() it states: If value is halfway between

  • 0

Looking at the msdn documentation for Convert.ToInt32() it states:

If value is halfway between two whole numbers, the even number is
returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

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

Why is this?

Surely it would be more logical to round to the nearest whole number, wouldn’t it? If so, 4.5 would become 5, and 5.5 would become 6, which seems to be more intuitive.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T03:04:19+00:00Added an answer on June 8, 2026 at 3:04 am

    The History section of the Wikipedia entry for Rounding has some statements about the role of “round to even” in computing. Interestingly, it appears “Bankers Rounding” has little evidence to state it was official in any sense of the word, so can only be chalked up as slang terminology.

    It is only “more logical” if you subscribe to that rounding mechanism. Bankers rounding (which is the default in this case) is also perfectly logical.

    Imagine if banks rounded up to the nearest penny for every fractional amount, they would make a lot less (lose a lot of, for the cynical) money with the millions upon millions of transactions that are processed daily. OK, so this example is cynical.

    Going towards the nearest even number (or odd, but history chose otherwise) means that not every rounding resolution goes up, some can now go down. When you put this to the law of averages, it becomes a fair solution to use when considering who is responsible for paying for the extra half penny.

    As for why this was chosen for the framework, this question attempts to address it:

    Why does .NET use banker's rounding as default?

    Of course, this all harks back to financial days and its applicability to integral numbers could be questioned, but why bother? Accept it, override it if you want to, just understand how it works.


    For people wondering how to change the default rounding:

    If you are providing a non-integer to Convert.ToInt32 you will first actually need to do something like Convert.ToDouble and then Math.Round with the overload to change the rounding logic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking at WCF documentation in the MSDN ( http://msdn.microsoft.com/en-us/library/bb332338.aspx ), and have come
I'm looking to get an MSDN Subscription and I see a number of sites
Looking at the MSDN documentation, I can't find a way to lock VertexBuffers so
I was looking at the msdn documentation and I am still a little confused
I'm looking for an example scenario where this function could be used. MSDN documentation
Looking at the MSDN documentation, it is not quite clear to me when a
I was just looking at the MSDN documentation for ConcurrentDictionary , and I saw
I'm looking at the MSDN subscription comparison ( http://msdn.microsoft.com/en-us/subscriptions/subscriptionschart.aspx ) and am a bit
I am extremely new to Direct2D after just looking at the MSDN start guide
MSDN has the functionality I'm looking for here . Since microsoft recognizes the usefulness

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.