Floating point representation can support larger values in comparision to integer representation

Parveez Ahmed

I have googled over this,but couldn't find how, although it is a simple thing to answer for someone who knows it. I want to know how floating point can store large numbers which can't be stoed by integer representation. In the tutorials all that I could read about significand,exponent and bases but couldn't find my answer. Could anyone come up to solve it? For example,I have to represent a number larger than 2147483647 in a 32-bit system, then how it is done in floating point representation as opposed to integer representation.

Jongware

Suppose you assume this convention: the last two digits of your integer denote the power-of-10 of the remainder. Then you can store numbers up to 21474835 * 10^99 in a single integer. (You would also need to program all arithmetic methods to use it a such.)

To use floating point numbers in the same way, you can use the same convention. Since a signed integer stores 9 decimals (10, but the first one can only be 0, 1 or 2), you could say that the decimal period is behind the first decimal. So to store "1234.56" you would use

123456004

-- the decimal point convention says this is "1.23456 times 10^4", and that is the same value you stored.

Astute readers will notice that you cannot store 'every possible number' this way. Exceeding the maximal number of allowed decimals, for example, will have them thrown away. You can also either not store negative numbers or values smaller than 1 (please deduce why).

How is this relevant to your question? This is exactly how floating point numbers are stored, albeit with other conventions than I outlined. A bit is set aside to use as sign; a number of bits hold the "decimal" part, and another set of bits hold the "exponent" part.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Custom Floating Point Representation

From Dev

Custom Floating Point Representation

From Dev

Pattern matching and floating point representation

From Dev

constexpr: errors with floating point representation?

From Dev

Floating point notation representation in java specification

From Dev

Npgsql: Old floating point representation for timestamps not supported

From Dev

Displaying IEEE 754 floating point representation in GDB?

From Dev

Floating point representation (using bitwise operators)

From Dev

Reciprocal representation of integers in floating point numbers

From Dev

IEE754 - Floating point number representation

From Dev

Can python's math.ceil function get tricked from floating point representation error?

From Dev

Does the C++ standard specify anything on the representation of floating point numbers?

From Dev

Why does multiplying and dividing by N "fix" floating point representation?

From Dev

Why does multiplying and dividing by N "fix" floating point representation?

From Dev

decimal representation of an integer in R

From Dev

Counting the binary representation of an Integer

From Dev

Notation for fixed point representation

From Dev

awk float point representation

From Dev

split on integer values but not floating point values

From Dev

Turn integer representation of a price to a double representation

From Dev

String representation of special values

From Dev

How to check that IEEE 754 single-precision (32-bit) floating-point representation is used?

From Dev

How to get a floating-point number from its binary representation in Java?

From Dev

Dividing uint64_t by numeric_limits<uint64_t>::max() to a floating point representation

From Dev

numpy Boolean array representation of an integer

From Dev

Binary representation of a 32 bits integer

From Dev

numpy Boolean array representation of an integer

From Dev

Convert textual representation of number to integer

From Dev

Multiplication with Fixed point representation in VHDL

Related Related

  1. 1

    Custom Floating Point Representation

  2. 2

    Custom Floating Point Representation

  3. 3

    Pattern matching and floating point representation

  4. 4

    constexpr: errors with floating point representation?

  5. 5

    Floating point notation representation in java specification

  6. 6

    Npgsql: Old floating point representation for timestamps not supported

  7. 7

    Displaying IEEE 754 floating point representation in GDB?

  8. 8

    Floating point representation (using bitwise operators)

  9. 9

    Reciprocal representation of integers in floating point numbers

  10. 10

    IEE754 - Floating point number representation

  11. 11

    Can python's math.ceil function get tricked from floating point representation error?

  12. 12

    Does the C++ standard specify anything on the representation of floating point numbers?

  13. 13

    Why does multiplying and dividing by N "fix" floating point representation?

  14. 14

    Why does multiplying and dividing by N "fix" floating point representation?

  15. 15

    decimal representation of an integer in R

  16. 16

    Counting the binary representation of an Integer

  17. 17

    Notation for fixed point representation

  18. 18

    awk float point representation

  19. 19

    split on integer values but not floating point values

  20. 20

    Turn integer representation of a price to a double representation

  21. 21

    String representation of special values

  22. 22

    How to check that IEEE 754 single-precision (32-bit) floating-point representation is used?

  23. 23

    How to get a floating-point number from its binary representation in Java?

  24. 24

    Dividing uint64_t by numeric_limits<uint64_t>::max() to a floating point representation

  25. 25

    numpy Boolean array representation of an integer

  26. 26

    Binary representation of a 32 bits integer

  27. 27

    numpy Boolean array representation of an integer

  28. 28

    Convert textual representation of number to integer

  29. 29

    Multiplication with Fixed point representation in VHDL

HotTag

Archive