[comp.sys.mac.programmer] ATOF bug of THINK C4.0 ?

sshimoji@aludra.usc.edu (Shunichi Shimoji) (11/22/89)

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 <stdio.h>
#include <stdlib.h>
#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 <sshimoji@aludra.usc.edu>
Computer Science Department
University of Southern California