[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
real numbers

Real numbers

A real number is a number that can have digits after the dot, unlike an integer number. So it can have values between two consecutive integer numbers.

In most programming languages it is written like 123.456. Optionally an exponent can be added like 123.456e7, which means the number equals 123.456*10^7.

How a number is implemented in bits and bytes depends on the CPU. On most CPUs it is implemented as a sign, a mantissa and an exponent, where the mantissa is a number between 0.5 and 0.99999..., making the number equal sign*mantissa*2^exponent. Many platforms support two different real numbers, one using 4 bytes and one using 8 bytes. In programming languages these are often called float and double respectively. Which one should be used, is a tradeoff between speed and memory usage versus precision.



last edited (July 26, 2003) by markvp, Number of views: 2137, Current Rev: 2 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.