comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick J Chackowsky" <nick@arcticmail.com>
Subject: C++ to Ada95 -- bitten!
Date: Sat, 9 Sep 2000 20:24:09 -0500
Date: 2000-09-09T20:24:09-05:00	[thread overview]
Message-ID: <6oBu5.666$zo.17816@news1.mts.net> (raw)

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





             reply	other threads:[~2000-09-10  1:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-10  1:24 Nick J Chackowsky [this message]
2000-09-10  2:28 ` C++ to Ada95 -- bitten! Al Christians
2000-09-10  3:07 ` (null)
2000-09-10  4:49   ` Nick J Chackowsky
2000-09-10  7:39     ` Laurent Guerby
2000-09-10 15:47       ` 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