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,38064b40418e66c2 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!w56g2000hsf.googlegroups.com!not-for-mail From: Martin Newsgroups: comp.lang.ada Subject: Re: Question about Float Date: Mon, 3 Dec 2007 03:23:56 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <87hcj0xerd.fsf@ludovic-brenta.org> NNTP-Posting-Host: 20.133.0.8 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1196681037 24922 127.0.0.1 (3 Dec 2007 11:23:57 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 3 Dec 2007 11:23:57 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: w56g2000hsf.googlegroups.com; posting-host=20.133.0.8; posting-account=g4n69woAAACHKbpceNrvOhHWViIbdQ9G User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11,gzip(gfe),gzip(gfe) Content-Disposition: inline Xref: g2news1.google.com comp.lang.ada:18702 Date: 2007-12-03T03:23:56-08:00 List-Id: On 3 Dec, 10:18, Ludovic Brenta wrote: > axtens writes: > > G'day everyone, > > > What is the size/precision of a Float in Ada? Under GNAT/GCC it > > appears to be equivalent to a VB6 Single. Under ObjectAda is appears > > to be a full 8 byter, similar to VB6's Double. But is it? > > > I'm confused. > > The range and precision of Float are implementation-defined and change > between e.g. 32-bit, 64-bit platforms and Intel platforms where there > is a 80-bit floating-point type and PowerPC that has a 128-bit > floating-point type. Therefore you should not use Float. Define your > own floating-point type such that its representation matches that of > Visual Basic. Surely you mean " Define your own floating-point type such that its accuracy requirements are met"? e.g. type Real is digits 7; -- or 8 or 10 or whatever your app requires? If you are interfacing with an 'outside world' (e.g. a .dll) you can define wrappers in terms of types defined in standard "package Interfaces". Cheers -- Martin