C Floating point arithmetic -- single is enough sometimes
John Gilmore
gnu at l5.uucp
Sun Dec 8 12:13:22 AEST 1985
One application that rarely requires double precision is graphics.
All the math required to scale and render graphical/geometric objects
can be done in single precision without a problem, since the resolution
of the final output is going to be like 10 bits (1024 bit wide screen).
Even for a laser printer, add 3 or 4 bits. You're still well within
single precision. I think Lucasfilm was trying movies at 4096 or 8192
points, still fine. When Sun recompiled its SunCore libraries to use
single precision internally (including in function arguments), using
unsupported compiler options, it sped up a *lot*, and gave the same
results on the screen.
[For calculating the math that *generates* the figures you are going
to display, you might need doubles. But not to go from "world coordinates"
to "screen coordinates" and render them on the screen.]
More information about the Comp.lang.c
mailing list