Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Floting point

Status
Not open for further replies.

RamiLearner

Mechanical
Oct 13, 2002
3
I'm wondering about how floting point datas stors in the computer storage and what is the relation between these types of datas and logarithmic calculation.
ofcourse, as i know we have a storage of 1 charachter for sign, the other for exponent and the last for mantessa.
but, i don't know the relation between floting point type of data and logarithmic calculation.

Thanks in advance
 
Replies continue below

Recommended for you

Floating point data is stored as sign, mantissa and exponent. It is base10 arithmetic, although the method of storing the actual numbers is base2 (binary). Binary storage doesn't change the essence of the floating point number being represented--base10.

(The mantissa can get you into trouble though, depending on what you are trying to use it for. Try printing float variable 1.234 as an int, 6 digits long. It is slightly inaccurate, but that's due to binary to decimal storage differences.)

I'm not sure what you mean about how it relates to logarithmic computation unless you are interested in base e arithmetic. Please clarify.
 
Hi PL1Rocks and Thanks,
In fact this statment has written in an IT book:
"the computer stores a floating point number as a logarithm using binery numbers"
could you please explaine about above?

 

Hi

In my opinion the form of the number is exponential and not logarithmic.

example number: (16 bit)

1 0101 01000100101

the sign, exponent, and the mantissa

Kim
 
Most computers use a binary type of logic to store data ( including floating point numbers ). As already pointed out, there are several parts to store... sign, exponent and mantissa. Characters are not used to store this data though. Generally, bits are.

On many computers, a single byte consist of 8 bits. Each bit can be on or off ( hence, binary ). You really only need a single bit to indicate a positive or negative number. Other bits are used to indicate values ( generally to a power of 2 ).

One major point to note is that different computers store this data in different ways. There is no universal standard ( not even close ).

I suggest that you do a web search for floating point arithmetic and storage methods. I'm very sure that you will find several sites which will give you insight into how a "typical" computer handles floating point values. Be warned though... this really is not as simple of a subject as many people assume.

Dan :)
 
A brief summary of one of the many floating point representations is here:


This is only one of many. You will need to look at your operating system manual and programming language manual to find which representation they are using.

You will also notice that many standards use 2 or 3 different levels of precision, each defined differently
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor