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: 103376,9b4538cfeb0c3576 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.84.MISMATCH!xlned.com!feeder1.xlned.com!news.netcologne.de!newsfeed-fusi2.netcologne.de!newsfeed.straub-nv.de!open-news-network.org!news2.arglkargh.de!news.tornevall.net!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Float conversion Date: Thu, 29 Jul 2010 12:08:59 -0700 Organization: TornevallNET - http://news.tornevall.net Message-ID: References: <9e669a3b-1013-4bd1-b372-5f7dfa46d083@f42g2000yqn.googlegroups.com> <1q5zc0ais535h$.1jqwfxhj9cflc$.dlg@40tude.net> <4c519968$0$6893$9b4e6d93@newsspool2.arcor-online.net> <1d1txn4x3r5xn.1trm4gx9n87gm$.dlg@40tude.net> NNTP-Posting-Host: 3b70f89f545eba577082e23459c80a9f Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: 3eeadf46c553b8023542c36100116362 X-Complaints-To: abuse@tornevall.net User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6 X-Complaints-Language: Spoken language is english or swedish - NOT ITALIAN, FRENCH, GERMAN OR ANY OTHER LANGUAGE! In-Reply-To: X-UserIDNumber: 1738 X-Validate-Post: http://news.tornevall.net/validate.php?trace=3eeadf46c553b8023542c36100116362 X-Complaints-Italiano: Non abbiamo padronanza della lingua italiana - se mandate una email scrivete solo in Inglese, grazie X-Posting-User: 0243687135df8c4b260dd4a9a93c79bd Xref: g2news1.google.com comp.lang.ada:12679 Date: 2010-07-29T12:08:59-07:00 List-Id: On 07/29/2010 11:21 AM, Henrique wrote: > > As I declared the type with 6 digits, I expected that it would make > the comparison only for these digits (this would gave var4 = var1). "digits N" means the compiler will use at least Ceiling (N * log2 (10) ) bits for the mantissa, 'Image will produce a string with N digits, and an instantiation of Ada.Text_IO.Float_IO will output N digits by default. There was an effect on the minimum size of the exponent in Ada 83, but I don't think that applies any more. (There are probably other cases as well where the "digits" value has an effect that I can't think of at the moment.) But all operations, including comparisons, take place in the underlying implementation or with greater precision. Most x86-type processors have HW floating-point types that correspond to digits 7, 15, and 18 (IIRC), so on such a machine you should expect your compiler to choose one of those. All computations are done using the digits-18 representation, so there doesn't seem to be much reason to choose another representation. -- Jeff Carter "Well, a gala day is enough for me. I don't think I can handle any more." Duck Soup 93