comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam@spam.com>
Subject: Re: ambiguous universal_fixed_expression
Date: Sat, 27 Nov 2004 20:52:15 GMT
Date: 2004-11-27T20:52:15+00:00	[thread overview]
Message-ID: <3O5qd.1778$u81.1697@newsread3.news.pas.earthlink.net> (raw)
In-Reply-To: <coag9b$62s$03$1@news.t-online.com>

xadian wrote:

> x := sol_Ty((var_Ar(f)*var_Ar(b))-(var_Ar(e)*var_Ar(c))/z);
> -- x : sol_Ty := (f*b - e*c) / z;
> 
> I get the following errors:
>  > ambiguous universal_fixed_expression
>  > possible interpretation as type "Standard.duration"
>  > possible interpretation as type "sol_Ty" defined at line 8
> The minus in the middle is highlighted after the errors.

Multiplication and division of fixed-point values results in a value of 
Universal_Fixed (ARM 4.5.5). Addition and subtraction, on the other 
hand, take arguments of a specific fixed-point type and return a value 
of the same type. So you need to tell the compiler the type of the 
results of the multiplications:

X := Sol_Ty (Sol_Ty'(Var_Ar (F) * Var_Ar (B) ) -
              Sol_Ty'(Var_Ar (E) * Var_Ar (C) ) / Z);

-- 
Jeff Carter
"Many times we're given rhymes that are quite unsingable."
Monty Python and the Holy Grail
57




      parent reply	other threads:[~2004-11-27 20:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-27 18:16 ambiguous universal_fixed_expression xadian
2004-11-27 19:08 ` Martin Krischik
2004-11-27 20:52 ` Jeffrey Carter [this message]
replies disabled

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