comp.lang.ada
 help / color / mirror / Atom feed
From: Dave Thompson <david.thompson1@worldnet.att.net>
Subject: Re: C to JVM, time to revive JGNAT?
Date: Mon, 21 Aug 2006 06:04:53 GMT
Date: 2006-08-21T06:04:53+00:00	[thread overview]
Message-ID: <co5ie2hdjaporbq7be39rf6vbl51r08495@4ax.com> (raw)
In-Reply-To: 1155178411.944408.186560@i3g2000cwc.googlegroups.com

On 9 Aug 2006 19:53:32 -0700, napi@axiomsol.com wrote:

> Hi:
> 
> Colin Paul Gloster wrote:

> > AMPC covers a very large subset of ANSI C (1989). A notable difference is
> > that "double" in AMPC is 32 bits long. In order to utilize 64-bit
> > floating point you can use "DOUBLE".
> >
> > [..]"
> >
> > So though AMPC is described as standard in one part of the documentation,
> > it is not standard and someone's interpretation of what the C standard
> > even is seems to be amiss.
> 
> The ANSI C standard does not specify the size of scalar variables since
> there are various CPU architectures out there from 8 bits to 64 bits,

Doesn't specify size, except that all objects (other than bitfields in
structs) are an integral number of bytes (where byte is the smallest
addressing unit supported by the C implementation, possibly larger
than the actual machine byte in rare cases) and all flavors of char
types are exactly one byte (ditto).

But DOES specify required minimum range and for floating point
precision, which imply requirements on representation.

> etc.  So, making "double" to be 32 bits or even 16 bits is still
> conformant to the ANSI C standard, although abnormal.  AMPC actually
> supports 64 bit floating point by means of the type DOUBLE.
> 
With base 2 as is now essentially universal it isn't possible to meet
the requirements for 'float' with with less than 1+14 'mantissa' bits
and 8 exponent bits = 23, and 'double' (and 'long double') with less
than 1+30+8 = 39. Even with base 256 (and variation in precision much
worse than S/360's base 16) you need 5 exponent bits = 20 and 36.
(Yes, mathematically this isn't the correct meaning of 'mantissa' but
that's now the common usage.)

Re the other reply:
ANSI does not require standards to be replaced after 10 years, only to
be reviewed for _possible_ revision. Looking through their catalog, I
have noted standards 15 or 20 or more years old still 'reaffirmed'.
Actually since 1990 their C standard has just been an adoption of the
ISO (actually JTC1) standard, which was indeed revised late in 1999,
although due to procedural delays the ANSI date on it is May 2000.

- David.Thompson1 at worldnet.att.net



  parent reply	other threads:[~2006-08-21  6:04 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-09  8:11 C to JVM, time to revive JGNAT? Dmitry A. Kazakov
2006-08-09  9:48 ` Jean-Pierre Rosen
2006-08-09 10:15 ` Georg Bauhaus
2006-08-09 10:59 ` Colin Paul Gloster
2006-08-09 16:01   ` Martin Krischik
2006-08-10  7:18     ` Maciej Sobczak
2006-08-10 10:08       ` Martin Krischik
2006-08-09 22:39   ` Björn Persson
2006-08-09 23:58     ` Georg Bauhaus
2006-08-10 22:31       ` Björn Persson
2006-08-11  9:51         ` Georg Bauhaus
2006-08-10  7:10     ` Maciej Sobczak
2006-08-10 19:38       ` Simon Wright
2006-08-10 21:55       ` Björn Persson
2006-08-11  7:54         ` Martin Krischik
2006-08-11  8:04         ` Maciej Sobczak
2006-08-11  9:00           ` Dmitry A. Kazakov
2006-08-14  7:09             ` Maciej Sobczak
2006-08-14  8:01               ` Dmitry A. Kazakov
2006-08-14  9:33                 ` Maciej Sobczak
2006-08-14 11:47                   ` Dmitry A. Kazakov
2006-08-21  6:04         ` Dave Thompson
2006-08-10  2:53   ` napi
2006-08-10 10:43     ` Colin Paul Gloster
2006-08-10 11:14       ` Martin Krischik
2006-08-21  6:04     ` Dave Thompson [this message]
2006-08-09 16:01 ` Martin Krischik
2006-08-09 18:13   ` Dmitry A. Kazakov
2006-08-10 10:11     ` Martin Krischik
2006-08-10 13:26       ` Dmitry A. Kazakov
2006-08-10 17:07         ` Martin Krischik
2006-08-10 19:18           ` Dmitry A. Kazakov
replies disabled

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