On Wednesday, April 17, 2002, at 07:45 PM, Julian Foad wrote:

> Jonathan Polley wrote:
>>
>> My C training goes back to circa 1985, at which time all floats were
>> passed as doubles.
>
> Yes, they were.
>
>>  In fact, the modern C/C++ compilers to which I have
>> access still do this (I don't use gcc, except to rebuild FlightGear).
>
> Oh?  Which compilers?

We use Rational Ada/C for our embedded development.  Their C compiler 
passes passes floats as doubles for C, but will pass a Float as a single, 
Long_Float as double, in Ada (nothing like consistency).  We get burned by 
that every so often.  This is primarily for Solaris (were our simulation 
environment runs), so it may be a Sun convention as well.  I believe I 
have also seen this interaction between the Aonix Ada compiler and MSVC.  
I tend to see these problems due to our mixed language development.

[...]

> Maybe it was unpredictable before standardisation, but I feel that's 
> unlikely; I don't have the original (K&R) reference book to check.  
> Another possibility is that the teacher couldn't predict the results 
> because he/she didn't know the language well enough ... that's quite 
> common, unfortunately.

My C profs were a couple of C hackers form AT&T Bell Labs.  Given what 
their area of research was (data communication), I don't think this was 
the issue.



My main purpose for the single- vs. double-precision question was this:  
On this program, given its hardware requirements, does it make sense to 
work with single-precision floating point numbers?  In our case, there 
will be no speed improvement (all platforms need FPUs) and the space 
savings is negligible.  The other issues are just personal whininess.  My 
primary job is supporting avionics software development.  Because it is 
written in Ada, and my work has become mostly C, I get to deal with many 
strange forms of interaction.


Jonathan Polley


_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to