Re: Integer Coersion




Gordon Sande wrote
On 2007-02-07 09:38:24 -0400, mecej4 <mecej4@xxxxxxxxxxxxx> said:


It has been repeatedly observed in the past that byte size is not a unique
specification of a floating point format. There can be an exchange between
the lengths of the exponent and significand fields.

There have been major vendors with popular computers lines for which this
was true. Consider the various VAXen.

I think this is confusing a number of separate (but related) issues, none of
which are covered much by the standard.

1) Storage bit length for a type kind
2) Bits per storage byte
3) Data representation within the bitfield of a type kind

Fortran type kind parameters will not guarantee any of these and it is very
difficult at runtime to check what these values actually are - hence all the
messing around with the Transfer function to maybe, if you are lucky, find
out how many bits there are in a non-default floating point type kind. The
only useful standard function we have is bit_size, which only works on
integers.

It is difficult to believe that in 2007 we are still messing around in the
dark like this. All we need are a few simple, standard intrinsic inquiry
functions (or modules) to either tell us what is going on in the compiler or
to tell us that the compiler is in a little world of its own where the
question doesn't make any sense.

Paul Holden


.



Relevant Pages

  • Re: IIR filter help
    ... Why do you think floating point will work in an interrupt? ... For one because interrupts are outside the C standard so their ... IIRC I've also run across a compiler that had non-reentrant long ...
    (comp.arch.embedded)
  • Re: Integer Coersion
    ... specification of a floating point format. ... which are covered much by the standard. ... Data representation within the bitfield of a type kind ... out how many bits there are in a non-default floating point type kind. ...
    (comp.lang.fortran)
  • Re: A question about memory allocation
    ... what is required by the standard is that one be able to ... tell that a particular reference is to a floating point numbers. ... Now it is possible, with appropriate declarations and compiler settings, ...
    (comp.lang.lisp)
  • Re: IEEE 754 floating point standard
    ... Does VC6 comply with the IEEE 754 floating point standard? ... but VC6 doesn't do any floating-point operations. ... It might even depend on the optimisation settings of the compiler. ...
    (microsoft.public.vc.language)
  • Re: Hollerith constants on a little endian machine
    ... There wasn't a standard to follow at the time. ... doesn't specify which bits go where for floating point values. ... My personal opinion - I would be very upset if a compiler took it upon ...
    (comp.lang.fortran)