Blame src/math/gen/tof.c

Szabolcs Nagy c58b8e
#include <stdio.h>
Szabolcs Nagy c58b8e
#include <stdlib.h>
Szabolcs Nagy c58b8e
#include <errno.h>
Szabolcs Nagy c58b8e
Szabolcs Nagy c58b8e
int main(int argc, char *argv[])
Szabolcs Nagy c58b8e
{
Szabolcs Nagy c58b8e
	int i;
Szabolcs Nagy c58b8e
	float f;
Szabolcs Nagy c58b8e
	double d;
Szabolcs Nagy c58b8e
	long double ld;
Szabolcs Nagy c58b8e
	char *eptr;
Szabolcs Nagy c58b8e
Szabolcs Nagy c58b8e
	for (i = 1; i < argc; i++) {
Szabolcs Nagy c58b8e
		errno = 0;
Szabolcs Nagy c58b8e
		f = strtof(argv[i], &eptr);
Szabolcs Nagy c58b8e
		printf("%.42f  (*eptr:%d errno:%d)\n", f, *eptr, errno);
Szabolcs Nagy c58b8e
		errno = 0;
Szabolcs Nagy c58b8e
		d = strtod(argv[i], &eptr);
Szabolcs Nagy c58b8e
		printf("%.42f  (*eptr:%d errno:%d)\n", d, *eptr, errno);
Szabolcs Nagy c58b8e
		errno = 0;
Szabolcs Nagy c58b8e
		ld = strtold(argv[i], &eptr);
Szabolcs Nagy c58b8e
		printf("%.42Lf  (*eptr:%d errno:%d)\n", ld, *eptr, errno);
Szabolcs Nagy c58b8e
	}
Szabolcs Nagy c58b8e
	return 0;
Szabolcs Nagy c58b8e
}