home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!enterpoop.mit.edu!eru.mt.luth.se!kth.se!news.kth.se!harald
- From: harald@marilyn.bion.kth.se (Harald Winroth)
- Newsgroups: comp.lang.c
- Subject: Re: Unwanted float to double conversion in variable length arg lists?
- Message-ID: <HARALD.93Jan22133850@marilyn.bion.kth.se>
- Date: 22 Jan 93 12:38:50 GMT
- References: <C18924.2yp@inews.Intel.COM>
- Sender: usenet@kth.se (Usenet)
- Organization: Royal Institute of Technology, Stockholm, Sweden
- Lines: 18
- In-Reply-To: dmarer@td2cad.intel.com's message of 21 Jan 93 23:25:15 GMT
- Nntp-Posting-Host: marilyn.bion.kth.se
-
- In article <C18924.2yp@inews.Intel.COM> dmarer@td2cad.intel.com (Dennis Marer) writes:
-
- > I've got a curious problem when passing floats in a variable length argument
- > list...they are automatically converted to doubles, EVEN when I typecast.
- > Consider:
-
- From K&R, 2nd ed:
-
- ...trailing arguments beyond the explicitly typed parameters suffer default
- argument promotion...
-
- which means that all float parameters corresponding to ... are promoted to
- doubles (just like ALL float parameters were promoted in old K&R C).
-
- -----------------------------------------------------------------------------
- Harald Winroth | Computational Vision and Active Perception Laboratory,
- harald@bion.kth.se | Royal Institute of Technology, Stockholm, Sweden.
- -----------------------------------------------------------------------------
-