grichter opened this issue on Sep 11, 2007 · 15 posts
kuroyume0161 posted Wed, 12 September 2007 at 12:57 PM
Of course any base computer representation is binary. But there are differing type representations (EBIDIC, ASCII, ANSI, Unicode for text characters for instance). Floating point values are usually stored in IEEE Sign-Exponent-Mantissa representation. In the CPU they are usually stored as double (or maybe long-double 64-bit these days). When the value is demoted to a shorter representation (such as long-double to double or double to float), a certain amount of precision is lost in the process. This is just the nature of binary digital representations.
Basically, the more math you do on a floating point 'value', the more loss of precision creeps in. This occurs no matter what you do. The best algorithms are designed with an error consideration and may either minimize it or 'rectify' it when possible.
So, there are roundoff errors and truncation errors which can creep into even seemingly stable floating point values over time if not checked and considered.
C makes it easy to shoot yourself in the
foot. C++ makes it harder, but when you do, you blow your whole leg
off.
-- Bjarne
Stroustrup
Contact Me | Kuroyume's DevelopmentZone