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,38d8b4bd1cb45ff X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: Re: choice of fixed point type Date: 2000/03/06 Message-ID: #1/1 X-Deja-AN: 593927778 References: <8a0lm4$trr$1@nnrp1.deja.com> X-Complaints-To: abuse@pacbell.net X-Trace: news.pacbell.net 952371111 206.170.2.164 (Mon, 06 Mar 2000 11:31:51 PST) Organization: SBC Internet Services NNTP-Posting-Date: Mon, 06 Mar 2000 11:31:51 PST Newsgroups: comp.lang.ada Date: 2000-03-06T00:00:00+00:00 List-Id: >(I thought GNAT 3.12p compiled, without warning, the example >even when "type Duration is delta ..." was replaced with >"type T is delta ...". I don't have access to 3.12p right >now, so I can't verify that.) Using "type D is delta ..." also fails to generate any warning. >> The code in question is really non-portable at best, wrong >> at worst, but not illegal if there is only one fixed-point >> type visible. At least that's my reading. The code in question arose from testing around an "Ada surprise". An execution error had been traced to where a programmer had written something like Long_Float(N * Ada.Numerics.pi) instead of Long_Float(N) * Ada.Numerics.pi resulting in the use of (relatively imprecise) type Duration for the multiply instead of Long_Float. Standard.Duration was of course (silently) visible, and there was no other fixed point type in this code, so the compiler did what the programmer said, but not what he wanted.