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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b9b7539b5df3ca8e X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: delta? Date: 1999/02/27 Message-ID: #1/1 X-Deja-AN: 449411763 Sender: matt@mheaney.ni.net References: <7b9bl7$ki5$1@eng-ser1.erg.cuhk.edu.hk> NNTP-Posting-Date: Sat, 27 Feb 1999 14:14:43 PDT Newsgroups: comp.lang.ada Date: 1999-02-27T00:00:00+00:00 List-Id: ycli6@se.cuhk.edu.hk (yukchi) writes: > what is the meaning of delta and digits in the following sentence? > type Money is delta 0.01 digits 15; This is the declaration of a decimal fixed point type. It means values of Money as small as 1 cent are exactly representable. Compare this to a floating point type, which can only approximate the value of 1 cent. You could do something like that using just plain fixed point types, like this: Money_Delta : constant := 0.01; Money_First : constant := Integer'Pos (Integer'First) * Money_Delta; Money_Last : constant := Integer'Pos (Integer'Last) * Money_Delta; type Money is delta Money_Delta range Money_First .. Money_Last; for Money'Small use Money_Delta; which gives you the range you can fit in an object with the same precision as Integer. BTW: The attribute T'Pos is handy here, because it allows you to convert a static subtype to a univeral type, which you can then use in a universal expression.