Single precision math in C

Doug Gwyn gwyn at smoke.BRL.MIL
Tue Dec 13 03:30:01 AEST 1988


In article <88Dec10.135843est.10521 at ephemeral.ai.toronto.edu> bradb at ai.toronto.edu writes:
>Because some of the machines that I run on have no floating point processor,
>it is useful to be able to force single-precision math for speed.  

So, use "float" for such data types (don't forget to cast the inherently
double floating-point constants, e.g. (float)1.0).

Watch out for varargs parameters and arguments to functions when you do
this; normally those will have to be double.



More information about the Comp.lang.c mailing list