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,dcab94c78b71ea2b X-Google-Attributes: gid103376,public From: "Robert I. Eachus" Subject: Fixed Point Numbers Date: 1999/05/27 Message-ID: <374DBCE1.9FB720E6@mitre.org>#1/1 X-Deja-AN: 482870695 Content-Transfer-Encoding: 7bit Organization: The MITRE Corporation X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-05-27T00:00:00+00:00 List-Id: Philip Bradley wrote: > The first definition is the desired definition (and compiles using > Gnat). Unfortunately the 2nd one is as close as I can get using a > different compiler - one I am having to use, but not by choice! You should be pleased that both compilers will allow you to get what you want, and my hat is off to GNAT for supporting the first definition. > I am really only interested in the effect on the attributes, operators > etc. of Long_type if the 2nd definition is used rather than 1st. Does > anyone know? In both cases you should get exactly the same representation, and operations that use hardware overflow to do range checking, although you may (or may not) get different values for 'Last. The definition of fixed point types cleverly does not require that the end points of the specified range be values of the (sub)type. This allows the compiler in both cases to exclude the value +180.0 from the representable values for the type and fit it exactly in 32-bits. (By the rules you can also exclude -180.0, but I would expect this only on ones-complement machines.) -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...