Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!ncrlnk!ncrcae!PEDEV!rogerson From: rogerson@PEDEV.Columbia.NCR.COM (Dale Rogerson) Newsgroups: comp.windows.ms Subject: Re: FAR functions and float types Message-ID: <2710@PEDEV.Columbia.NCR.COM> Date: 15 Sep 89 20:57:05 GMT References: <246400022@uxa.cso.uiuc.edu> <1989Sep14.101215.21281@ziebmef.mef.org> Reply-To: rogerson@PEDEV.Columbia.NCR.COM (Dale Rogerson) Organization: NCR Corp., Engineering & Manufacturing - Columbia, SC Lines: 18 People have been having problems with functions to which tthey have passed float types. They solved this problem by uses doubles instead of floats. Why does using doubles instead of floats work? Because in ANSI C (which MSC 5.1 is partly, somewhat, maybe, kinda, like ...) all float types are promoted to doubles!!! If you what to use floats and pass floats you must use function prototypes. Function prototypes stop the compiler from making these type of automaic promotions. I found this out by reading the book: ANSI C: A Lexical Guide Published by Mark Williams Company Prentice Hall ISBN 0-13-037814-3 I just checked it out from the library today. Learn something new everyday. -----Dale Rogerson-----