Alberto Fasso' <[log in to unmask]> wrote:
...
On Sat, 6 Mar 1999, Richard Maine wrote:
>> The compiler is allowed a lot of freedom in line splitting
>> with list-directed output. Some compilers might write it all on one
>> line, but this certainly isn't required.
>
> Right. But personally I find it a very bad thing. Portability in
> my opinion means also that you should get the same results on
> any platform. I had to struggle with a number of programs
> I had to port from VAX to UNIX, and where all output, originally
> nice and friendly, had become an unreadable mess. It took me a lot of time
> to convert hundreds of list-directed WRITE statements to formatted.
Well, if all hardware were identical, this might be made to work. But
only if all developers made the same decisions about what record sizes
were acceptable, what the default precision of numerical output should
be, whether to supress trailing zeros, etc.. If the hardware numerical type
carries n-bits of precision, the default decimal precision for output should
be m-digits where 10^(m-1) > 2^n. This guarantees that writing out data
to a file and then reading in back in later will generate the same internal value.
For IEEE single precision, n is 24 so m should be 9. For IEEE double,
n is 53 so m should be 17. Few implementations do this, but I'd not
like to see the standard prohibit it.
--
J. Giles
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|