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 Path: g2news1.google.com!postnews.google.com!t5g2000prd.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: simple question on long_float/short_float Date: Thu, 30 Sep 2010 08:56:47 -0700 (PDT) Organization: http://groups.google.com Message-ID: <6fb31720-a2d8-4347-aa36-92fdb82bc026@t5g2000prd.googlegroups.com> References: NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1285862208 5884 127.0.0.1 (30 Sep 2010 15:56:48 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 30 Sep 2010 15:56:48 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t5g2000prd.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:14336 Date: 2010-09-30T08:56:47-07:00 List-Id: On Sep 30, 1:31=A0am, "Nasser M. Abbasi" wrote: > Is this for real? :) No, it's for float. Ada doesn't use the REAL keyword. > So, what is Ada's Float? 32 bit or 64 bits? The language does not define this. The language is designed to be implemented on many processors, some of which have floats that are neither 32 nor 64 bits. Others have mentioned 80-bit floats. ADI SHARC has 40-bit floats. Some older systems (Honeywell 600 series e.g.) were based on 36-bit words and their floats were 36 bits. No idea what Crays define, but it wouldn't surprise me if there are processors designed for heavy scientific computation that would require floats of even greater precision than these. Anyway, it was deliberate that the language did not define exactly what "Float", "Long_Float", and "Short_Float" are supposed to look like, so you shouldn't use those types if you care what kind of float you're getting. If you need the type to match a type in some other language implemented on that same processor, then use one of the types in Interfaces.Fortran or Interfaces.C or whatever. If you need your floating-point type to be specifically 32 or 64 or 57 bits for some other reason, then either define your own, or (if you don't care about portability) check to see what your particular compiler's definitions for that particular processor are. (Even on the same processor, the definition of "Float" may be different between different vendors' compilers, because the language doesn't define this.) You can use Float or Long_Float if you just want any floating-point type that meets or exceeds the minimum standard in 3.5.7(14-15) and don't really care how it's implemented. But only then. -- Adam