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,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f6be630961a327bf,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-09-09 18:23:15 PST Path: supernews.google.com!sn-xit-02!sn-east!supernews.com!news-feed.riddles.org.uk!nntp.cs.ubc.ca!cyclone.bc.net!news-in.mts.net!news1.mts.net.POSTED!not-for-mail From: "Nick J Chackowsky" Newsgroups: comp.lang.ada Subject: C++ to Ada95 -- bitten! X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Message-ID: <6oBu5.666$zo.17816@news1.mts.net> Date: Sat, 9 Sep 2000 20:24:09 -0500 NNTP-Posting-Host: 205.200.235.137 X-Complaints-To: admin@mts.net X-Trace: news1.mts.net 968548994 205.200.235.137 (Sat, 09 Sep 2000 20:23:14 CDT) NNTP-Posting-Date: Sat, 09 Sep 2000 20:23:14 CDT Organization: MTS Internet Xref: supernews.google.com comp.lang.ada:564 Date: 2000-09-09T20:24:09-05:00 List-Id: So just when I think I'm getting the idea of Ada95, along comes this problem, demonstrated by an admittedly contrived program. Gnat 3.13p crashes trying to compile this: with ada.float_text_io; with ada.numerics; with ada.numerics.elementary_functions; use ada.numerics.elementary_functions; procedure crash is f, g : float; begin ada.float_text_io.get(f); g := 2.7183 ** (-5340)/f + 21.5; end crash; Now, I can eliminate the problem by changing the -5340 to -5340.0, but it took me a *long* time to see that (in a student's code). I actually thought I had a virus infecting the student's computer until I watched the "problem" follow him from workstation to workstation! I guess my question is, what _category_ of error is this? I know to look (now) for an integer in a floating-point calculation, but that doesn't tell me what _else_ I should be looking for to avoid these "virus-like" crashes. -- ===================================== N J Chackowsky Brandon, MB Canada