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.
There are always going to be differences between hardware.
For example, list output on a 32-bit system will give you about
7 digits' of floating-point decimal output. But what if the system is 64 bits?
Do you expect that the system would chop off the extra precision
to give you 7 digits still? Of course not. List output gives the
number of digits appropriate to that system's hardware.
It's useful as a general output, it's simple to write, and doesn't require
detailed formats.
But if you want always to output with a specific precision on
all systems, you will have to use E-type formatted output.
Back to portability:
>"Portability in
> my opinion means also that you should get the same results on
> any platform."
Some programs (e.g. numerical f.p.) won't give the same results
on different machines because of different word sizes. There are
also such problems as loss of significance when the word size
is small.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|