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 3341934
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:46:48+00:00 2026-05-18T00:46:48+00:00

Possible Duplicate: Why does Math.Floor(Double) return a value of type Double? Why does C#

  • 0

Possible Duplicate:
Why does Math.Floor(Double) return a value of type Double?

Why does C# Math.Floor() return double instead of int

From the MSDN Docs:

Returns the largest integer less than or equal to the specified double-precision floating-point number

it says it returns an integer. Its ok to return a double, I can always cast it to an int but its just quite strange, isn’t it?

  • 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-18T00:46:48+00:00Added an answer on May 18, 2026 at 12:46 am

    Not really, considering that a double can be a much higher magnitude than an int. You wouldn’t want to overflow an int with the large value that a double could be.

    Just to show you what I mean:

    Double.MaxValue = 1.7976931348623157E+308

    Integer.MaxValue = 2,147,483,647

    So you could have a double that is 3,000,000,000.50 and floor it, which would overflow the max value of an int.

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

Sidebar

Related Questions

Possible Duplicate: What does Asynchronous means in Ajax? jQuery ajax return value Trying to
Possible Duplicate: Does C# support return type covariance? I'm not sure if I'm just
Possible Duplicate: Why does C# execute Math.Sqrt() more slowly than VB.NET? I'm running into
Possible Duplicate: Does SQL Server 2005 have an equivalent to MySql’s ENUM data type?
Possible Duplicate: Does an open-ended interval implementation exist for Java? i have an int
Possible Duplicate: Does COUNT(*) always return a result? Is it possible in any scenario
Possible Duplicate: Does using references instead of pointers, resolve memory leaks in C++? When
Possible Duplicate: Does this type of memory get allocated on the heap or the
Possible Duplicate: Does the size of an int depend on the compiler and/or processor?
Possible Duplicate: Does this type of memory get allocated on the heap or the

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.