Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!elroy!cit-vax!tybalt.caltech.edu!gtchen From: gtchen@tybalt.caltech.edu (George T. Chen) Newsgroups: comp.lang.c Subject: float functions Summary: How do I do it? Message-ID: <7441@cit-vax.Caltech.Edu> Date: 28 Jul 88 18:21:30 GMT Sender: news@cit-vax.Caltech.Edu Reply-To: gtchen@tybalt.caltech.edu.UUCP (George T. Chen) Organization: California Institute of Technology Lines: 27 Forgive me if I sound naive... How do I get c to recognize a function as returning a float and not a double? It seems the moment I declare something as a function, the compiler cast it as double. I am primarily using sizeof to determine the type. Here is a sample code. float f1() { return( (float) 10.0); } main() { float f1(), res; res = f1(); printf("sizeof f1() is %d\n",sizeof(f1())); printf("sizeof res is %d\n",sizeof(res)); } This program invariable returns 8 and 4, not 4 and 4. Help. George End of article 93282 (of 93283)--what next? [npq] Message from sysop: Your account has just been revoked for reading news! Ha Ha.. just fooling. I'll let you back on now.