passing floats to foo(,...)
Karl Botts
kdb at chinet.chi.il.us
Sun Aug 6 18:05:09 AEST 1989
Is there any reasonable way pass a single-precision float to a function
taking a variable number of arguments? The standard says something to
the effect of: "In the absence of a function prototype, floats will be
widened to double." I guess I am willing to stipulate that ",..." is
equivalent to
"in the absence of a prototype." Still, it seems a shame that the float
gets widened (by no means a cheap operation) only to have me force it
back to float in the first line of the function.
I suppose I could do something ugly with a union, or something like
that...
More information about the Comp.std.c
mailing list