comp.lang.ada
 help / color / mirror / Atom feed
* Overhead for type conversions?
@ 2003-07-25  1:01 Bobby D. Bryant
  2003-07-25  2:36 ` Robert I. Eachus
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Bobby D. Bryant @ 2003-07-25  1:01 UTC (permalink / 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




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-07-27 13:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-25  1:01 Overhead for type conversions? Bobby D. Bryant
2003-07-25  2:36 ` 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

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