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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:08:59+00:00 2026-05-27T23:08:59+00:00

Int is 4 bytes with a range of +- 2^31 Float is 4 bytes

  • 0

Int is 4 bytes with a range of +- 2^31
Float is 4 bytes with a range of +- 1.2E(+- 38)

Float encompasses so many more points on the Real Line and yet is equal to the size of int. Is the Sign-Exponent-Fraction representation of float so awesome (or the 2’s complement of Int so pathetic) that this size disparity arises? Am I missing something?

I just find it highly surprising that something which represents (virtually) the entire real line is of the same size as that of which represents the Integers.

  • 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-27T23:09:00+00:00Added an answer on May 27, 2026 at 11:09 pm

    In C, an int and float each take up 4 bytes, or 32 bits, in memory. The difference between int and float is not the number of bits they take up in memory, but rather in the way the ALU (Arithmetic Logic Unit) treats each number. An int is treated as the integer represented by its bits using two’s complement notation. A float, on the other hand, is encoded (typically in IEEE 754 format) to represent a number in exponential form (e.g. 2.9979245×108 is a number in exponential form with base 2.9979245 and exponent 8). The number of significant digits in the decimal representation of a floating point number is always about the same: 6-9 digits for 32-bit float and 15-17 digits for a 64-bit float (or double). For example, the value 4.2949673×109 is what I get as the decimal representation of the closest 32-bit float to the number 232 , and it has 8 significant digits.

    It can be a common misconception that a floating point number somehow represents more information than a fixed-point number, which is not true. While a 32-bit float can represent numbers of greater magnitude than a 32-bit int, it cannot represent all of them with as much precision. In total, this answer derives that a 32-bit float can represent around 4,278,190,081 unique numbers. This other answer contains a nice plot showing how these 32-bit floats are distributed on the real line.

    While an int may not be able to represent numbers with as large of a magnitude as a float, it represents each number in its valid range (-232 to 232-1) with the same precision. The largest number it can represent is 2,147,483,647 and has 10 significant digits. And in total, it can represent 232=4,294,967,296 unique numbers, which is more than for the 32-bit float!

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

Sidebar

Related Questions

Correct me if I am wrong, int is 4 bytes, with a range of
How can I convert from bytes to float in php? Like in Java int
I am trying to convert an int into three bytes representing that int (big
An int ( Int32 ) has a memory footprint of 4 bytes. But what
class a { int variable;//4 bytes } class a { static int variable;//? bytes
How can I convert a string of bytes into an int in python? Say
I know that a char and an int are calculated as being 8 bytes
I want to know how to announce int to make sure it's 4 bytes
Can a double (of a given number of bytes, with a reasonable mantissa/exponent balance)
I have some data in int variables in Java (range between 0 and 64000).

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.