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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:33:13+00:00 2026-05-17T22:33:13+00:00

This is IEEE 754 standard question. I don’t completely understand the mechanics behind it.

  • 0

This is IEEE 754 standard question. I don’t completely understand the mechanics behind it.

public class Gray {  
    public static void main(String[] args){
        System.out.println( (float) (2000000000) == (float) (2000000000 + 50));
    }
}
  • 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-17T22:33:14+00:00Added an answer on May 17, 2026 at 10:33 pm

    Because a float can only hold about 7 to 8 significant digits. That is, it doesn’t have enough bits to represent the number 2000000050 exactly, so it gets rounded to 2000000000.

    Specifically speaking, a float consists of three parts:

    • the sign bit (1 bit)
    • the exponent (8 bits)
    • the significand (24 bits, but only 23 bits are stored since the MSB of the significand is always 1)

    You can think of floating point as the computer’s way doing scientific notation, but in binary.

    The precision is equal to log(2 ^ number of significand bits). That means a float can hold log(2 ^ 24) = 7.225 significant digits.

    The number 2,000,000,050 has 9 significant digits. The calculation above tells us that a 24-bit significand can’t hold that many significant digits. The reason why 2,000,000,000 works because there’s only 1 significant digit, so it fits in the significand.

    To solve the problem, you would use a double since it has a 52-bit significand, which is more than enough to represent every possible 32-bit number.

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

Sidebar

Related Questions

Refreshing on floating points (also PDF ), IEEE-754 and taking part in this discussion
I know the IEEE 754 floating point standard by heart as I had to
This might seem like a stupid question I admit. But I'm in a small
This is a difficult and open-ended question I know, but I thought I'd throw
This most be the second most simple rollover effect, still I don't find any
This is a self-explanatory question: Why does this thing bubble into my try catch's
While, as far as I remember, IEEE 754 says nothing about a flush-to-zero mode
I need to represent an IEEE 754-1985 double (64-bit) floating point number in a
Is it possible to get the raw bytes of a floating point (IEEE-754) Number
This is a bit of a long shot, but if anyone can figure it

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.