From: Marin David Condic <mcondic.nospam@acm.org>
Subject: Legitimate Argument_Error Or Compiler Bug?
Date: 2000/09/25
Date: 2000-09-25T19:02:11+00:00 [thread overview]
Message-ID: <39CFA126.6669BF45@acm.org> (raw)
The following code raises Argument_Error when attempting to compute a
positive fraction to a real power. Now so far as I can tell, there is
nothing particularly undefined about a fraction raised to a real power,
so Argument_Error seems to be out of place here. Either I've got
something wrong or I've tripped across a bug in the compiler (GNAT
3.13p). Is there a reason this exception should be raised or should I
submit a bug report?
Thanks for the help.
MDC
with Ada.Text_Io ;
with Ada.Numerics.Long_Long_Elementary_Functions ;
use Ada.Numerics.Long_Long_Elementary_Functions ;
--
procedure What_The_Heck is
Alpha : Long_Long_Float := 0.05;
Log_Term : Long_Long_Float;
Neg_Log_Term : Long_Long_Float;
Power_Term : Long_Long_Float;
--
begin
--
Log_Term := Log(Alpha/2.0 , 10.0) ;
Neg_Log_Term := - Log_Term ;
--
Ada.Text_Io.Put ("Neg_Log_Term ** 2 is ") ;
Power_Term := Neg_Log_Term ** 2 ;
Ada.Text_Io.Put_Line (Long_Long_Float'Image(Power_Term) ) ;
--
Ada.Text_Io.Put (" Log_Term ** 2 is ") ;
Power_Term := Log_Term ** 2 ;
Ada.Text_Io.Put_Line (Long_Long_Float'Image(Power_Term) ) ;
--
Ada.Text_Io.Put ("Neg_Log_Term ** 2.0 is ") ;
Power_Term := Neg_Log_Term ** 2.0;
Ada.Text_Io.Put_Line (Long_Long_Float'Image(Power_Term) ) ;
--
Ada.Text_Io.Put (" Log_Term ** 2.0 is (Argument_Error)") ;
Power_Term := Log_Term ** 2.0 ; -- Dies here!
Ada.Text_Io.Put_Line (Long_Long_Float'Image(Power_Term) ) ;
--
end What_The_Heck ;
--
======================================================================
Marin David Condic - Quadrus Corporation - http://www.quadruscorp.com/
Send Replies To: m c o n d i c @ q u a d r u s c o r p . c o m
Visit my web site at: http://www.mcondic.com/
"Because that's where they keep the money."
-- Willie Sutton when asked why he robbed banks.
======================================================================
next reply other threads:[~2000-09-25 0:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-09-25 0:00 Marin David Condic [this message]
2000-09-25 0:00 ` Legitimate Argument_Error Or Compiler Bug? Marin David Condic
2000-09-30 0:00 ` Robert Dewar
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox