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,184737148aef02ac X-Google-Attributes: gid103376,public From: robert_dewar@my-dejanews.com Subject: Re: Fixed point multiplication ambiguity Date: 1999/01/15 Message-ID: <77md7r$905$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 432740598 References: <369E14CA.90715966@lmco.com> X-Http-Proxy: 1.0 x3.dejanews.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Fri Jan 15 03:38:36 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-01-15T00:00:00+00:00 List-Id: In article , stt@houdini.camb.inmet.com (Tucker Taft) wrote: > Marc A. Criley (marc.a.criley@lmco.com) wrote: > > : The following test program is compilable by Rational Apex, but > : GNAT rejects it with: > > : tf.adb:5:38: type cannot be determined from context > : tf.adb:5:38: explicit conversion to result type required > > : I've studied the LRM 4.5.5(13-20), but who has the correct > : interpretation doesn't quite jump out at me, though I am > : leaning towards one over the other. > : -------------------- > > : procedure Tf is > > : D : Duration := 5.0; > > : Dec_Delt : Integer := Integer (D * 10.0 + 0.5); > > This is legal. Overload resolution interprets "D * 10.0" as returning > universal_fixed. This is implicitly convertible to Duration (as well > as any other fixed point type), as is 0.5. Presuming there is no > other fixed-point type with a directly visible "+", this should resolve, > and use the "+" of Duration. > > : begin > : null; > : end Tf; > > : ----------------------- > : Marc A. Criley > : Chief Software Architect > : Lockheed Martin M&DS > : (610) 354-7861 > > -- > -Tucker Taft stt@averstar.com http://www.averstar.com/~stt/ > Technical Director, Distributed IT Solutions (www.averstar.com/tools) > AverStar (formerly Intermetrics, Inc.) Burlington, MA USA > -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own