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-Thread: a07f3367d7,e96fdf9557794655 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.glorb.com!feeder.erje.net!news.tornevall.net!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Type casting Date: Mon, 26 Oct 2009 13:02:40 -0700 Organization: TornevallNET - http://news.tornevall.net Message-ID: References: <4acc8c20$0$284$14726298@news.sunsite.dk> <4acdb7aa$0$283$14726298@news.sunsite.dk> <1256585214.3272.12.camel@HERMES> NNTP-Posting-Host: 4ddaf13fa70d7e0cd0bb494571cfadb8 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: 706c1c76765aa91acf42396c2a3b57f4 X-Complaints-To: abuse@tornevall.net X-Complaints-Language: Spoken language is english or swedish - NOT ITALIAN, FRENCH, GERMAN OR ANY OTHER LANGUAGE! In-Reply-To: <1256585214.3272.12.camel@HERMES> X-Validate-Post: http://news.tornevall.net/validate.php?trace=706c1c76765aa91acf42396c2a3b57f4 X-SpeedUI: 1738 X-Complaints-Italiano: Parlo la lingua non � italiano User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) X-Posting-User: 9b22bfe2855937f9b3faeec7cfc91295 Xref: g2news2.google.com comp.lang.ada:8795 Date: 2009-10-26T13:02:40-07:00 List-Id: Bruno wrote: > > I really do not know how to interpret the operation (E / 2) because > although the operation is composed of two numbers such as "Positive" > outcome can be of type "Float" and, of course, the "Integer" (attribute) > returns an integer but the closest to real number and what > need my program is that it returns the integer part regardless > the decimal part. E is Positive, a subtype of Integer, so the expression "E / 2" is an Integer expression, and converting it to Integer has no effect. "/" for Integer truncates towards zero, which seems to be what you want. The 'Truncation attribute function for floating-point types provides the integer part. -- Jeff Carter "We call your door-opening request a silly thing." Monty Python & the Holy Grail 17