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,58e0097f787e49d4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-01 19:05:09 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!news1.sttln1.wa.home.com.POSTED!not-for-mail From: "DuckE" Newsgroups: comp.lang.ada References: <8NkE7.221689$K6.106569186@news2> Subject: Re: Naturals and discrete types X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: Date: Fri, 02 Nov 2001 03:05:08 GMT NNTP-Posting-Host: 24.248.45.203 X-Complaints-To: abuse@home.net X-Trace: news1.sttln1.wa.home.com 1004670308 24.248.45.203 (Thu, 01 Nov 2001 19:05:08 PST) NNTP-Posting-Date: Thu, 01 Nov 2001 19:05:08 PST Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: archiver1.google.com comp.lang.ada:15607 Date: 2001-11-02T03:05:08+00:00 List-Id: One other point (especially if you're coming from C). When you convert a floating point value to an integer value using Integer( value ), Ada rounds, it does not trucate. Example: WITH Ada.Integer_Text_Io; WITH Ada.Text_Io; PROCEDURE Conversions IS BEGIN Ada.Text_Io.Put( "Integer(3.4) = " ); Ada.Integer_Text_Io.Put( Integer( 3.4 ), 2 ); Ada.Text_Io.New_Line; Ada.Text_Io.Put( "Integer(3.6) = " ); Ada.Integer_Text_Io.Put( Integer( 3.6 ), 2 ); Ada.Text_Io.New_Line; END Conversions; Output: Integer(3.4) = 3 Integer(3.6) = 4 If you need to trucate, you can use Integer( Float'Truncation( value ) ) SteveD > Everything is so damn simple isnt it? ;-> > > And I remember covering this subject early on in my textbook. > I'm a typical greenhorn I guess, making everything more complicated than > it has to be. > > Thanks for your patience. > > Clueless > chris@dont.spam.me