* Posts by Thomas Dean

1 post • joined 14 Aug 2006

The trouble with rounding floating point numbers

Thomas Dean

Financial Institutions do not use Float or Double

Financial and Insurance applications are not written using float in the first place. In fact the reference you make to risks has nothing to do with floating point numbers, but the concept of a float which is a sum of money. These applications are writting using decimal based arithmetic which is precise. In languages such as COBOL, RPG and PL/I, you specify the number of digits and the representation (Zoned Decimal = 1 digit per byte, or BCD = 2 digits per byte). Very specific rules are provided for overflow, underflow and roundoff and enforced by the langauage runtime. While I commend you for the idea of the article (most programmers know little about numeric programming) a bit more basic research would have make your exmaples more realistic.



Biting the hand that feeds IT © 1998–2017