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,379c1e544eb51c83 X-Google-Attributes: gid126597,public X-Google-ArrivalTime: 1982-11-03 23:01:29 PST Message-ID: Newsgroups: net.lang.ada Path: utzoo!decvax!harpo!eagle!jerry X-Path: utzoo!decvax!harpo!eagle!jerry From: eagle!jerry Date: Thu Nov 4 02:01:27 1982 Subject: Re: Fixed point data in Ada References: X-Google-Info: Converted from the original B-News header Posted: Wed Nov 3 10:18:38 1982 Received: Thu Nov 4 02:01:27 1982 Date: 1982-11-04T02:01:27+00:00 List-Id: This subject is more complicated than meets the eye. I will present some statements from the LRM LRM 3.5.9-3 defines the "delta" of an Ada fixed point type as the value given in the declaration which may be any positive real value. LRM 3.5.9-4 says that the "model numbers" for a fixed point type are multiples of "small" LRM 3.5.9-5 says "the number small is choosen as the largest power of two that is not greater than the specified delta. Alternatively, it is possible to specify the value of small by a length clause. (see 13.2)" LRM 13.2 defines "length clauses" which are a particular kind of "representation clause". In particular LRM 13.2-9 Defines a clause of the form for T'small use simple_expression and says "the type T must be a fixed point type. The expression must be a static expression of some real type; its value must not be greater than the delta of the type. The effect of the length clause is to use this value of small for the representation of values of the fixed point type." Taking all the above together it would seem that dollars could be specified by type money is delta .01 ; for money'small use .01 ; This should get a representation in which values of type money are represented in "cents". Great! But before you get excited let me quote one more paragraph of the LRM 3.5.9-11: "The fixed point declaration is illegal if no implementation defined type satisfies these requirements". (There must be at least one anonymous fixed point type according to LRM 3.5.9-7) My interpretation of this is: if your Ada compiler accepts the declaration and length clause it will give you the representation you want. But there is no guarantee that it will accept it. I hope this clears up some of the confusion. Jerry Schwarz harpo!eagle!jerry