comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Krischik <martin@krischik.com>
Subject: Re: ambiguous universal_fixed_expression
Date: Sat, 27 Nov 2004 20:08:48 +0100
Date: 2004-11-27T20:08:48+01:00	[thread overview]
Message-ID: <2879069.TtGHld9loP@linux1.krischik.com> (raw)
In-Reply-To: coag9b$62s$03$1@news.t-online.com

xadian wrote:

> Hi
> 
> I've got a problem with an Ada program(surprise ;D).
> With this line:
> 
> 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.

> var_Ar is an array of the type sol_Ty and x is also sol_Ty. sol_Ty
> definition is a decimal fixed point:
>  > type sol_Ty   is delta 0.01 digits 18;
> I never worked with duration so can anyone tell me (or link something)
> what it is and why it can be missinterpreted in this case? And how i can
> GENERALLY solve it?!

Maybe you should try sol_Ty'( instead of sol_Ty(. The difference is subtle:
the first means "interpret as" the other "convert to". the ' notiation is
paricular usefull for contants like 1.0 or so.

With Regards

Martin

-- 
mailto://krischik@users.sourceforge.net
http://www.ada.krischik.com



  reply	other threads:[~2004-11-27 19:08 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 [this message]
2004-11-27 20:52 ` Jeffrey Carter
replies disabled

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