[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
real 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.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
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.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
