comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: simple question on long_float/short_float
Date: Thu, 30 Sep 2010 08:56:47 -0700 (PDT)
Date: 2010-09-30T08:56:47-07:00	[thread overview]
Message-ID: <6fb31720-a2d8-4347-aa36-92fdb82bc026@t5g2000prd.googlegroups.com> (raw)
In-Reply-To: i81htk$nqf$1@speranza.aioe.org

On Sep 30, 1:31 am, "Nasser M. Abbasi" <n...@12000.org> 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





  parent reply	other threads:[~2010-09-30 15:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-30  6:17 simple question on long_float/short_float Nasser M. Abbasi
2010-09-30  6:58 ` J-P. Rosen
2010-09-30  8:31   ` Nasser M. Abbasi
2010-09-30  8:45     ` Nasser M. Abbasi
2010-09-30  9:59       ` Mark Lorenzen
2010-09-30 13:30       ` Peter C. Chapin
2010-09-30  8:46     ` AdaMagica
2010-09-30 10:02     ` Georg Bauhaus
2010-09-30 15:37     ` Jeffrey Carter
2010-09-30 18:22       ` Nasser M. Abbasi
2010-09-30 21:21       ` Peter C. Chapin
2010-10-01  0:29         ` Nasser M. Abbasi
2010-10-01 11:13           ` Peter C. Chapin
2010-10-02 19:57         ` Simon Wright
2010-09-30 15:56     ` Adam Beneschan [this message]
2010-10-02  9:11 ` Nasser M. Abbasi
2010-10-02  9:48   ` Dmitry A. Kazakov
2010-10-02 20:09     ` Simon Wright
2010-10-02  9:56   ` Nasser M. Abbasi
2010-10-02 10:45   ` cjpsimon
2010-10-02 16:52   ` Jeffrey Carter
2010-10-02 20:01     ` Georg Bauhaus
replies disabled

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