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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,587583eece659d7a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-16 14:04:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: Kai =?iso-8859-1?Q?Gl=E4sner?= Newsgroups: comp.lang.ada Subject: Re: Why raises this an error? :-( Date: Sat, 16 Mar 2002 23:01:45 +0100 Organization: T-Online Message-ID: <3C93C0C9.14A5FC7D@t-online.de> References: <3C93A19C.67D6E442@t-online.de> <3C93ACE5.36B3BCE2@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.t-online.com 1016316095 01 17037 z-nyT1vESEASuO 020316 22:01:35 X-Complaints-To: abuse@t-online.com X-Sender: 320068638902-0001@t-dialin.net X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:21347 Date: 2002-03-16T23:01:45+01:00 List-Id: Thanks for the quick Response. The problem I have is, that the exponent is not an Integer (this was just a test-example to find out what is wrong) 1.0 - (GetTemperature(The, Alt)/Temp) ** 0.2349690 Where GetTemperature() can return a value < 0.0. But why is the value of the left operand not allowed to be negative according to the ARM? Jeffrey Carter wrote: > > Kai Gl�sner wrote: > > > > This: > > > > Alt_D := (-8.0/4.0) ** 2.0; > > > > raises this: > > > > raised ADA.NUMERICS.ARGUMENT_ERROR : a-ngelfu.adb:111 instantiated > > at a-nuelfu.ads:20 > > > > This: > > > > Alt_D := -2.0 ** 2.0; > > > > works fine! > > Exponentiation has higher precedence than unary minus (ARM 4.5), so this > is equivalent to > > Alt_D := -(2.0 ** 2.0); > > ARM A.5.1 says that Argument_Error is raised "by the exponentiation > operator, when the value of the left operand is negative". This is the > case in your first example. > > Since your exponent is an integer value, you can avoid this restriction > by using the predefined exponentiation operator for floating-point > types: > > Alt_D := (-8.0 / 4.0) ** 2; > > -- > Jeff Carter > "Your mother was a hamster and your father smelt of elderberries." > Monty Python & the Holy Grail