Article View: comp.std.c
Article #419passing floats to foo(,...)
From: Karl Botts
Date: Sun, 06 Aug 1989 08:05
Date: Sun, 06 Aug 1989 08:05
11 lines
959 bytes
959 bytes
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...
Technical Details
Message-ID:
<9183@chinet.chi.il.us>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mailrus!ncar!ames!pacbell!att!chinet!kdbShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mailrus!ncar!ames!pacbell!att!chinet!kdb From: kdb@chinet.chi.il.us (Karl Botts) Newsgroups: comp.std.c Subject: passing floats to foo(,...) Message-ID: <9183@chinet.chi.il.us> Date: 6 Aug 89 08:05:09 GMT Reply-To: kdb@chinet.chi.il.us (Karl Botts) Distribution: usa Organization: Chinet - Public Access Unix Lines: 11