From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_FROM_MTA_HEADER autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 126597,8019875eef785069 X-Google-Attributes: gid126597,public X-Google-Thread: 12da6b,8019875eef785069 X-Google-Attributes: gid12da6b,public X-Google-ArrivalTime: 1982-10-31 23:32:43 PST Message-ID: Newsgroups: net.lang.c,net.lang.ada Path: utzoo!decvax!harpo!npoiv!alice!mhtsa!eagle!cw X-Path: utzoo!decvax!harpo!npoiv!alice!mhtsa!eagle!cw From: eagle!cw Date: Mon Nov 1 02:32:41 1982 Subject: Rounding of Fixed Point in Ada References: X-Google-Info: Converted from the original B-News header Posted: Mon Nov 1 00:27:01 1982 Received: Mon Nov 1 02:32:41 1982 Date: 1982-11-01T02:32:41+00:00 List-Id: A recent article refers to Ada fixed point as a kind of "poor man's floating point." It is not that at all. First, it is in the language not because the designers necessarily wanted it there, but because the language specifications demanded it. Second, it attempts to provide the facility to manipulate data with a truly fixed radix point. The most common instance of this kind of data is money (with exactly two decimal places in the US), but much sensor data also has this property. Remember that Ada is a language for programs that handle real world external data. Third, the radix for fixed point numbers is (implicitly) binary, albeit the delta can be expressed in decimal. Finally, although the rounding rules are not easy to explain for Ada numbers (either fixed point or floating point), they are considerably more precise than are the rules in most languages. Should a program be one where detailed rounding control is necessary, Ada is more likely to provide that control than other languages. If there is to be more Ada discussion, should it be moved to net.lang.ada? Charles