[Info-vax] Current VMS engineering quality, was: Re: What's VMS up to these

Johnny Billquist bqt at softjar.se
Mon Mar 19 19:23:42 EDT 2012


On 2012-03-19 15.54, glen herrmannsfeldt wrote:
> Johnny Billquist<bqt at softjar.se>  wrote:
>
> (snip)
>
>> However, there still seem to be some debate about the real vs. double
>> floating point types as related to the PDP-11 architecture.
>
> Fortran pretty much requires a single and double precision floating
> point format. One or both can be done in software, but both should
> be there. Hardware targeting Fortran usually supports both, so it
> shouldn't be surprising that C also supports them.
>
> Though from the beginning C tried to be a systems programming
> language, and not a scientific programming language, one might
> argue that they weren't needed.
>
> Fortran was a popular language on the PDP-11, though, so the
> floating point processor would have been expected to support
> single and double precision.

Yes. But the PDP-11-centric detail of this story is why all constants 
and all computations in C are (or were) always done in double, even if 
you have simple floats. And the reason being that the FPP of the PDP-11 
have a mode bit, which determines in which precision computations are 
done, so it's either all single, or all double. Thus, using simple real 
in C just saves memory, but costs in conversations everywhere, and speed 
wise you'll always be doing double computations anyway, even if all you 
have are singles.
And that was apparently specified in the standard for C for a long 
while, but I think not anymore.

So, support for single precision in C was basically just that you could 
store them, but they were converted to doubles everywhere when used. Always.

	Johnny



More information about the Info-vax mailing list