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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:44:24+00:00 2026-06-06T14:44:24+00:00

Possible Duplicate: what the difference between the float and integer data type when the

  • 0

Possible Duplicate:
what the difference between the float and integer data type when the size is same in java?

As you probably know, both of these types are 32-bits.int can hold only integer numbers, whereas float also supports floating point numbers (as the type names suggest).

How is it possible then that the max value of int is 231, and the max value of float is 3.4*1038, while both of them are 32 bits?

I think that int‘s max value capacity should be higher than the float because it doesn’t save memory for the floating number and accepts only integer numbers. I’ll be glad for an explanation in that case.

  • 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-06T14:44:25+00:00Added an answer on June 6, 2026 at 2:44 pm

    Your intuition quite rightly tells you that there can be no more information content in one than the other, because they both have 32 bits. But that doesn’t mean we can’t use those bits to represent different values.

    Suppose I invent two new datatypes, uint4 and foo4. uint4 uses 4 bits to represent an integer, in the standard binary representation, so we have

    bits   value
    0000       0
    0001       1
    0010       2
    ...
    1111      15
    

    But foo4 uses 4 bits to represent these values:

    bits   value
    0000       0
    0001      42
    0010     -97
    0011       1
    ...
    1110      pi
    1111       e
    

    Now foo4 has a much wider range of values than uint4, despite having the same number of bits! How? Because there are some uint4 values that can’t be represented by foo4, so those ‘slots’ in the bit mapping are available for other values.


    It is the same for int and float – they can both store values from a set of 232 values, just different sets of 232 values.

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

Sidebar

Related Questions

Possible Duplicate: Difference between Color.red and Color.RED I have seen that the Java class
Possible Duplicate: Difference between “var” and “object” in C# I would like to know
Possible Duplicate: Difference between Activity Context and Application Context I want to know the
Possible Duplicate: Difference between -%> and %> in rails I need to know what
Possible Duplicate: Calculating the Difference Between Two Java Date Instances hi, I have two
Possible Duplicate: Calculating the Difference Between Two Java Date Instances time1: 17:05 time2: 17:08
Possible Duplicate: Difference between ref and out parameters in .NET I know that ref
Possible Duplicate: What is the difference between these two ways of allocating memory in
Possible Duplicate: Difference between static class and singleton pattern? Which is better in Java,
Possible Duplicate: Calculating the Difference Between Two Java Date Instances In Java, I want

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.