comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam@spam.com>
Subject: Re: Problems converting Float to Integer efficiently
Date: Thu, 09 Oct 2003 01:08:46 GMT
Date: 2003-10-09T01:08:46+00:00	[thread overview]
Message-ID: <yy2hb.2948$av5.2493@newsread3.news.pas.earthlink.net> (raw)
In-Reply-To: <KD1hb.8538$RU4.82065@newsfep4-glfd.server.ntli.net>

Dr. Adrian Wrigley wrote:
> 
> pragma Suppress (All_Checks);
> function X (A : Float) return Integer is
> begin
>    return Integer (Float'Floor (A));
> end X;

If 'Floor works for you (A is >= 0.0), then 'Truncation should also 
work. I have no idea what kind of object code it produces.

As always, if you want specific object code, you should use a machine 
code insertion.

-- 
Jeff Carter
"My brain hurts!"
Monty Python's Flying Circus
21




  reply	other threads:[~2003-10-09  1:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-09  0:06 Problems converting Float to Integer efficiently Dr. Adrian Wrigley
2003-10-09  1:08 ` Jeffrey Carter [this message]
2003-10-09  2:36 ` Jeff C,
2003-10-09  3:21   ` Dr. Adrian Wrigley
2003-10-09  3:36     ` Jeff C,
2003-10-17 20:57     ` Randy Brukardt
2003-10-09 22:36   ` Dr. Adrian Wrigley
2003-10-10  2:05     ` Jeff C,
2003-10-10 17:15     ` Robert I. Eachus
2003-10-11  1:47     ` Waldek Hebisch
2003-10-09  7:10 ` Robert I. Eachus
replies disabled

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