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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e0423f8984d47f76 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-08 18:08:47 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!sjc70.webusenet.com!news.webusenet.com!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Problems converting Float to Integer efficiently References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Thu, 09 Oct 2003 01:08:46 GMT NNTP-Posting-Host: 63.184.8.228 X-Complaints-To: abuse@earthlink.net X-Trace: newsread3.news.pas.earthlink.net 1065661726 63.184.8.228 (Wed, 08 Oct 2003 18:08:46 PDT) NNTP-Posting-Date: Wed, 08 Oct 2003 18:08:46 PDT Xref: archiver1.google.com comp.lang.ada:510 Date: 2003-10-09T01:08:46+00:00 List-Id: 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