comp.lang.ada
 help / color / mirror / Atom feed
From: Martin <martin.dowie@btopenworld.com>
Subject: Re: Question about Float
Date: Mon, 3 Dec 2007 03:23:56 -0800 (PST)
Date: 2007-12-03T03:23:56-08:00	[thread overview]
Message-ID: <ad6004ac-2207-4b97-908e-e7db2edcc347@w56g2000hsf.googlegroups.com> (raw)
In-Reply-To: 87hcj0xerd.fsf@ludovic-brenta.org

On 3 Dec, 10:18, Ludovic Brenta <ludo...@ludovic-brenta.org> 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



  reply	other threads:[~2007-12-03 11:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-03 10:03 Question about Float axtens
2007-12-03 10:18 ` Ludovic Brenta
2007-12-03 11:23   ` Martin [this message]
2007-12-04  9:31     ` Georg Bauhaus
2007-12-05  5:47       ` axtens
2007-12-07 10:38         ` amado.alves
2007-12-03 12:53 ` anon
2007-12-04  3:22   ` axtens
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox