comp.lang.ada
 help / color / mirror / Atom feed
From: "Bobby D. Bryant" <bdbryant@mail.utexas.edu>
Subject: Overhead for type conversions?
Date: Thu, 24 Jul 2003 19:01:44 -0600
Date: 2003-07-24T19:01:44-06:00	[thread overview]
Message-ID: <pan.2003.07.25.01.01.43.5699@mail.utexas.edu> (raw)


Given these declarations -

   type f1 is new float;
   type f2 is new float;

   function "*"( left : in f1; right : in f2 ) return f1 is
   begin
      return( left * f1( right ) );
   end "*";

and given that run-time range checks are enabled, should I expect my
compiler to execute range checking code for each f1*f2 multiplication,
or will the compiler conclude from the definitions that the two types
are always convertible without error regardless of the specific value,
and thus not generate any code for a range check?

(In practice the compiler is GNAT.)

Thanks,
-- 
Bobby Bryant
Austin, Texas




             reply	other threads:[~2003-07-25  1:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-25  1:01 Bobby D. Bryant [this message]
2003-07-25  2:36 ` Overhead for type conversions? Robert I. Eachus
2003-07-25  7:12   ` Bobby D. Bryant
2003-07-25 15:34 ` Matthew Heaney
2003-07-25 18:28 ` Randy Brukardt
2003-07-26 15:54 ` Nick Roberts
2003-07-26 16:01   ` Warren W. Gay VE3WWG
2003-07-26 23:39     ` Bobby D. Bryant
2003-07-27 13:41       ` Loop Optimisation [was: Overhead for type conversions?] Nick Roberts
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox