Xref: utzoo comp.sys.ibm.pc:9498 comp.lang.c:5545 Path: utzoo!mnetor!uunet!husc6!rutgers!princeton!phoenix!asjoshi From: asjoshi@phoenix.Princeton.EDU (Amit S. Joshi) Newsgroups: comp.sys.ibm.pc,comp.lang.c Subject: BUG in Turbo C v1.0 float ??? Message-ID: <1304@phoenix.Princeton.EDU> Date: 12 Dec 87 04:56:11 GMT Organization: Princeton University, NJ Lines: 33 Keywords: Turbo C, Bug, float, parameter passing Hello, I came accross what could be a bug or I am missing somthing very obvious but I know not. Here is a short bit of Turbo C code which seems to give VERY absurd results. /**** code begins here ***/ #include#define reals float main() { reals c; c = -3.0; print_f(c); } print_f(c) reals c;{ printf("%f\n",c); } /***** code ends here ***/ Output should be "-3.0" ? Well guess again I get "0.00". If I change the line "#define reals float" to "define reals double" the code works fine. What the hell is happening ???? I used a large memory model, tcc, and tlink. I used mathl.lib and fp87.lib libraries beside the standard c0l.obj and cl.lib files. Any clues ??? Any fixes. Obviously this is not the code I was working on but is the distilled trouble section (got at after a lot of time and trouble).