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,8c0fcfc0a87e61fc X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!news.mixmin.net!news.tornevall.net!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: simple question on long_float/short_float Date: Thu, 30 Sep 2010 08:37:52 -0700 Organization: TornevallNET - http://news.tornevall.net Message-ID: References: NNTP-Posting-Host: 018ccdda253d52034647fac63903ddc6 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: 5c2f7edc69e630711a04fc744778579c X-Complaints-To: abuse@tornevall.net User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.12) Gecko/20100915 Thunderbird/3.0.8 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=5c2f7edc69e630711a04fc744778579c 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:14335 Date: 2010-09-30T08:37:52-07:00 List-Id: On 09/30/2010 01:31 AM, Nasser M. Abbasi wrote: > > Thanks. Are you saying that in Ada I can't make double precision > variables and single precision variables? (as in Fortran?) > > Is this for real? :) Are you saying that in Fortran you can only make floating-point variables with one of two precisions? Is this for real? In Ada, you can create floating-point types (and declare variables of those types) with any precision supported by the compiler, from 1 to System.Max_Digits decimal digits of precision. > So, what is Ada's Float? 32 bit or 64 bits? So in Fortran, you cannot make use of the 80-bit floating-point type supported by most PC FPUs? In most languages (other than Ada), you have to use the numeric types provided by the language, and select the types that are the closest fit to the requirements of the problem. This is part of what is known as "translating the problem into the solution space", which makes the software harder to understand, since the reader has to understand both the problem and the translation chosen. In Ada, one can declare numeric types to match the requirements of the problem. This is part of what is known as "modeling the problem in the software", which is intended to make the software easier to understand, since there is no translation from problem to solution space to understand. Ada's Float is defined as "at least 6 decimal digits of precision". This definition is imprecise, presumably to discourage its use in favor of user-defined types. If the precision of a floating-point type is important to the problem, you won't use a predefined type, but will declare your own with the desired precision. Thinking in terms of declaring numeric types based on the needs of the problem, rather than choosing from language-supplied types, is part of the Ada Mind Set(tm). -- Jeff Carter "I'm particularly glad that these lovely children were here today to hear that speech. Not only was it authentic frontier gibberish, it expressed a courage little seen in this day and age." Blazing Saddles 88