On Sun, 2014-06-29 at 19:02 +0000, David Nadlinger via Digitalmars-d
wrote:
[…]
> There is nothing Humpty Dumpty about the current situation. You 
> are simply missing the fact that float and double are already 
> defined as 32 bit/64 bit IEEE 754 compliant floating point 
> numbers in the spec.
> 
> There is nothing ambiguous about that, just as char/int/long have 
> defined bit-widths in D.

I think I am probably just getting "bloody minded" here, but…

If D is a language that uses the underlying hardware representation then
it cannot define the use of specific formats for hardware numbers. Thus,
on hardware that provides IEEE754 format hardware float and double can
map to the 32-bit and 64-bit IEEE754 numbers offered. However if the
hardware does not provide IEEE754 hardware then either D must interpret
floating point expressions (as per Java) or it cannot be ported to that
architecture. cf. IBM 360.

Fortunately more recent IBM hardware has multiple FPUs per core, one of
which provides IEEE754 as an option. (Pity the other FPUs cannot be
used :-)

Corollary: if D defines the "hardware" representation in its data model
then it can only be ported to hardware that uses that representation.

PS Walter just wrote that the type real is not defined as float and
double are, so it does have a Humpty Dumpty factor even if float and
double do not.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: rus...@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to