Difference between revisions of "Floating Point"
no edit summary
imported>JOG |
imported>JOG |
||
Line 7: | Line 7: | ||
''(In real-life floating point numbers are to the base 10. The computer uses the base 2, which makes things a bit more complicated, but the basics are the same, so I use the base 10 for this explanation).'' | ''(In real-life floating point numbers are to the base 10. The computer uses the base 2, which makes things a bit more complicated, but the basics are the same, so I use the base 10 for this explanation).'' | ||
In school we learned how to write large numbers with exponents to save some space on paper and to make a calculation better readable: "1000000000" is the same as "10^9" and "1234000000" is "1.234 * 10^9" or "1.234E9". The same applies to small numbers: "0.000001234" is "1.234E-6" | In school we learned how to write large numbers with exponents to save some space on paper and to make a calculation better readable: "1000000000" is the same as "10^9" and "1234000000" is "1.234 * 10^9" or "1.234E9". The same applies to small numbers: "0.000001234" is "1.234E-6" | ||
When we have a limited length for the first floating point number (the "mantissa") very large or very small numbers will be truncated: Oblivion uses a precision of about 7 decimal-digits for the mantissa: | When we have a limited length for the first floating point number (the "mantissa") very large or very small numbers will be truncated: Oblivion uses a precision of about 7 decimal-digits for the mantissa: |