Path: utzoo!attcan!uunet!cs.utexas.edu!usc!merlin.usc.edu!aludra.usc.edu!sshimoji From: sshimoji@aludra.usc.edu (Shunichi Shimoji) Newsgroups: comp.sys.mac.programmer Subject: ATOF bug of THINK C4.0 ? Message-ID: <6611@merlin.usc.edu> Date: 21 Nov 89 19:58:12 GMT Sender: news@merlin.usc.edu Reply-To: sshimoji@aludra.usc.edu (Shunichi Shimoji) Organization: University of Southern California, Los Angeles, CA Lines: 27 I am using THINK C4.0 on MacSE/30 and I have found atof() does not work correctly for some strings. Here shows codes. Did anyone fix it or post weaver in the net? I belive a bug fix for scanf() were posted but not for atof.. right? ----------- SAMPLE ------------------- #include #include #define FDATA "1.0001" #define FDATA2 "0.0001" printAtof(char *fdata) { printf("%s = %f\n",fdata,atof(fdata)); } main() { printAtof(FDATA); /* This works. */ printAtof(FDATA2); /* But this does not. */ } ----------------------------------- S.Shimoji Computer Science Department University of Southern California