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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,88394cd819fe3197,start X-Google-Attributes: gid103376,public From: Marin David Condic Subject: Legitimate Argument_Error Or Compiler Bug? Date: 2000/09/25 Message-ID: <39CFA126.6669BF45@acm.org>#1/1 X-Deja-AN: 673983313 Content-Transfer-Encoding: 7bit Organization: Quadrus Corporation X-Accept-Language: en X-Server-Date: 25 Sep 2000 19:02:11 GMT Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-09-25T19:02:11+00:00 List-Id: 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. ======================================================================