Charles.Forsyth20060303a828770d19 years agoHistory
31 lines · 392 B · C
RawDownload
#include <lib9.h> static intstrtodf(void *vp){	return *(*((char**)vp))++;} doublestrtod(char *s, char **end){	double d;	char *ss;	int c; 	ss = s;	d = charstod(strtodf, &s);	/*	 * Fix cases like 2.3e+ , which charstod will consume	 */	if(end){		*end = --s;		while(s > ss){			c = *--s;			if(c!='-' && c!='+' && c!='e' && c!='E')				break;			(*end)--;		}	}	return d;}