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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,991f222102c1cd00 X-Google-Attributes: gid103376,public From: Niklas Holsti Subject: Re: Type Conversion Date: 1998/11/06 Message-ID: <36436189.83A0E296@icon.fi>#1/1 X-Deja-AN: 409235499 Content-Transfer-Encoding: 7bit References: <71g71d$r7d@news3.force9.net> <71lbsu$1ps@morgan.vf.lmco.com> Content-Type: text/plain; charset=us-ascii Organization: Space Systems Finland Ltd Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-11-06T00:00:00+00:00 List-Id: Arun Mangalam wrote: > > In article <71lbsu$1ps@morgan.vf.lmco.com>, Michael Kaufman > wrote: > > > >Note that the cast from float to integer will round. > > > > So, if A_Float contains the number 10.5 initially, A_Integer will equal > 11? I am asking because with my C background I would have thought > A_Integer would equal 10, because in C the fractions are truncated out. Yep, Integer(10.5) = 11, because rounding a value that is exactly half-way between two integers is defined to round away from zero. If you want to truncate, use Float'Truncation(10.5). Similar functions for 'Floor and 'Ceiling and so on are also available.