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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2d09fa6592c24a21,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-10 00:24:47 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-xfer.siscom.net!not-for-mail Message-ID: <3C8B184D.49214059@yahoo.com> Date: Sun, 10 Mar 2002 02:24:45 -0600 From: Anatoly Chernyshev X-Mailer: Mozilla 4.75 [en] (WinNT; U) X-Accept-Language: ru,en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: I think - it's a bug... Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Original-NNTP-Posting-Host: 206.250.224.11 X-Original-Trace: 10 Mar 2002 01:25:07 -0700, 206.250.224.11 X-COMPLAINTS: Report abuse to abuse@mhogaming.com Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com NNTP-Posting-Date: 10 Mar 2002 08:24:45 GMT NNTP-Posting-Host: 13a7a9df.news.newshosting.com X-Trace: DXC=W=cP82Ze>:LT:S:MGhH1XIX`1N4>^k1LCiF6BbIV4YYBLnHEXCOOR@O3J1@=7bLNPNM;lF[5C2PfHo5dZhTdOGRMoh3?Aa9Y?3B X-Complaints-To: abuse@newshosting.com Xref: archiver1.google.com comp.lang.ada:21011 Date: 2002-03-10T08:24:45+00:00 List-Id: Hello everybody! Look at this piece of code: ------------------------------------------------------------------------------------------------- WITH ada.text_io,ada.numerics.elementary_functions; USE ada.text_io, ada.numerics.elementary_functions; PROCEDURE el_stat_fun IS b : float := 7.5; a:float:=4.0; rr, z : float; r : float := 4.0; dz : float := 0.3; BEGIN FOR k IN 0..integer(b/dz) LOOP z:=float(k)*dz; put_line (float'image(1.0-(z/b))); rr:=-a*sqrt((1.0-(z/b)**2))+a+r; END LOOP; END el_stat_fun; ---------------------------------------------------------------------------------------------------- When compiled using GNAT 3.14 (WinNT sp 6) it raises ADA.NUMERICS.ARGUMENT_ERROR in sqrt function when k goes to 25 because the argument for sqrt becomes negative (like -X.XXXXXE-07 ... And this is a headache No 1). However, if one comments out the put_line string - everything works fine. I don't know whether this is a bug or feature, but any kind of help for how to avoid the situation when 1.0-1.0/1.0 yields something different from 0.0 will be greatly appreciated. Thanks in advance, Anatoly.