#include #include "ffp.h" FFP FFPLARGE = 1.0e10, FFPSMALL = 1.0e-10; #ifdef FASTFLOAT FFP atoFFP(string) register char *string; { register char *s; register FFP val; register int epart, fpart, fexp; val = (FFP)atoi(string); s = strchr(string,'e'); if (!s) s = strchr(string,'E'); epart = (s ? atoi(s+1) : 0); s = strchr(string, '.'); if (s) { for (++s, fpart=fexp=0; (*s <= '9') && (*s >= '0'); s++) { fexp--; fpart = fpart*10 + (*s - '0'); } if (val < 0.) fpart *= -1; val += (FFP)(fpart * pow(10., (FFP)fexp)); } return ((FFP)(val * pow(10., (FFP)epart))); } #endif