comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <Nick.Roberts@dial.pipex.com>
Subject: Re: Fixed point multiplication ambiguity
Date: 1999/01/29
Date: 1999-01-29T00:00:00+00:00	[thread overview]
Message-ID: <78r4qh$fcu$1@plug.news.pipex.net> (raw)
In-Reply-To: F696u2.Cp.0.-s@inmet.camb.inmet.com

Tucker Taft wrote in message ...
[...]
|: ... The D*10.0 does resolve as Tucker says, giving a universal_fixed. The
0.5
|: literal is a universal_real. Thus adding them gives us the pattern
|: "+"(universal_fixed,universal_real) return unknown. However, it is the
rule
|: in RM 8.6 [29,30] preferring root types that allows this to be resolved
into
|: the pattern "+"(root_real,root_real) return root_real implied by RM 4.5.3
|: [2]. So the expression D*10.0+0.5 returns a value of type root_real,
which
|: can then be converted to an integer and assigned to Dec_Delt.
|
|Sorry, but you are wrong.  Universal_fixed is *not* implicitly convertible
|to root_real.

Tucker is, of course, quite right. My slip.

|It is implicitly convertible to any *fixed point* type,
|and to universal_real (because any real type is implicitly convertible
|both *to* and *from* universal real), but *not* to root_real (I realize
|only a died-in-the-wool language lawyer will believe this reasoning).


|: However, the expression Integer(D*10.0+0.5) causes a root_real addition
and
|: conversion to integer to be executed dynamically.
|
|No, this expression uses Duration's "+", because this is effectively
|equivalent to:
|   Integer(Duration(D*10.0)+Duration(0.5))


I am not arguing with this, but which rule (or rules) in the RM specify the
above interpretation, please? I've searched and searched (even the AI95s)!
(Then again, I reckon my brain must be coming up for it's 20,000 mile
service anyway ;-)

|The whole fixed-point multiplication model is pretty obscure,
unfortunately.


But then I would say that, in general, the RM95 does an amazingly good job
of pinning down a slippery monster. I hope I haven't added to the confusion
too much :-(

Just off for a slice of humble pie. Tuck remains champ :-)
-------------------------------------------
Nick Roberts
-------------------------------------------







  parent reply	other threads:[~1999-01-29  0:00 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-14  0:00 Fixed point multiplication ambiguity Marc A. Criley
1999-01-14  0:00 ` Robert I. Eachus
1999-01-14  0:00 ` Tom Moran
1999-01-14  0:00 ` Tucker Taft
1999-01-15  0:00   ` robert_dewar
1999-01-28  0:00   ` Nick Roberts
1999-01-28  0:00     ` robert_dewar
1999-01-28  0:00     ` Tucker Taft
1999-01-28  0:00       ` robert_dewar
1999-01-29  0:00       ` Nick Roberts [this message]
1999-01-29  0:00         ` Tucker Taft
1999-01-29  0:00           ` Nick Roberts
1999-01-29  0:00             ` Tucker Taft
1999-02-01  0:00               ` Robert I. Eachus
1999-02-02  0:00               ` Building a compiler (was: Fixed point multiplication ambiguity) Nick Roberts
1999-02-03  0:00                 ` dennison
1999-02-03  0:00                 ` Chris Morgan
1999-02-04  0:00                   ` robert_dewar
1999-02-04  0:00                     ` Garbage collection - was " news.oxy.com
1999-02-04  0:00                       ` robert_dewar
1999-02-05  0:00                         ` Tom Moran
1999-02-05  0:00                         ` David Botton
1999-02-18  0:00                         ` news.oxy.com
1999-02-18  0:00                           ` Garbage collection - was Re: Building a compiler Samuel Mize
1999-02-19  0:00                             ` Samuel Mize
1999-02-18  0:00                           ` Garbage collection - was Re: Building a compiler (was: Fixed point multiplication ambiguity) David Botton
1999-02-18  0:00                           ` dewar
1999-02-18  0:00                           ` AdaHag
1999-02-19  0:00                           ` Steven Hovater
1999-02-20  0:00                           ` A Modest Defense of ACT (though they are big boys and can take care of themselves) Steve Quinlan
1999-02-21  0:00                             ` dewar
1999-02-22  0:00                               ` Matthew Heaney
1999-02-21  0:00                                 ` bill
1999-02-22  0:00                                   ` Larry Kilgallen
1999-02-22  0:00                                 ` dennison
1999-02-22  0:00                             ` dennison
1999-02-24  0:00                               ` Steve Quinlan
1999-02-25  0:00                                 ` dewar
1999-02-25  0:00                                   ` Steve Quinlan
1999-02-25  0:00                                     ` robert_dewar
1999-02-25  0:00                                 ` dennison
1999-02-26  0:00                                   ` Steve Quinlan
1999-02-26  0:00                                     ` dennison
1999-02-27  0:00                                       ` Simon Wright
1999-02-27  0:00                                         ` Dave Taylor
1999-02-28  0:00                                       ` dewar
1999-02-05  0:00                     ` GC+HC for GNAT/GCC (was: Building a compiler) Nick Roberts
     [not found]                       ` <m33e4jvs1n.fsf@muc.de>
1999-02-06  0:00                         ` GC+FSD for GNAT/GCC Nick Roberts
1999-02-07  0:00                           ` robert_dewar
1999-02-05  0:00                   ` Building a compiler Nick Roberts
1999-02-05  0:00                     ` Tucker Taft
1999-02-06  0:00                       ` Nick Roberts
1999-01-30  0:00             ` Fixed point multiplication ambiguity robert_dewar
1999-02-02  0:00               ` Building a compiler (was: Fixed point multiplication ambiguity) Nick Roberts
1999-02-03  0:00                 ` Tucker Taft
1999-02-03  0:00                 ` robert_dewar
1999-01-14  0:00 ` Fixed point multiplication ambiguity Matthew Heaney
1999-01-14  0:00 ` bob
1999-01-14  0:00 ` David C. Hoos, Sr.
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox