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

  • SEARCH
  • Home
  • 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 6019759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:28:04+00:00 2026-05-23T03:28:04+00:00

When I make a division in C#, it automaticaly rounds down. See this example:

  • 0

When I make a division in C#, it automaticaly rounds down. See this example:

double i;
i = 200 / 3;
Messagebox.Show(i.ToString());

This shows me a messagebox containing “66”. 200 / 3 is actually 66.66666~ however.

Is there a way I can avoid this rounding down and keep a number like 66.6666667?

  • 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-05-23T03:28:05+00:00Added an answer on May 23, 2026 at 3:28 am

    i = 200 / 3 is performing integer division.

    Try either:

    i = (double)200 / 3

    or

    i = 200.0 / 3

    or

    i = 200d / 3

    Declaring one of the constants as a double will cause the double division operator to be used.

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

Sidebar

Related Questions

To make it short: hibernate doesn't support projections and query by example? I found
I was trying to make an CSS division box with content in it as
I am developing a web application and now I need to make this application
How can i make the div around a two column division(jQuery-ui portlets) arrangement dynamically
I'm trying to make a polynomial operator (sum, rest, multiplication and division of two
I want to make a faq panel when user ask any question it show
Let me make this clear, I have this enum: enum Token { Number(v:Float); Identifier(v:String);
Make a new AS3 Document in Flash, paste in the following code and run
make is not only useful for building your programming project, but it seems to
To make things easier when switching between machines (my workstation at the office and

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.