xref: /third_party/musl/libc-test/src/math/gen/toa.c
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/musl/libc-test/src/math/gen/
1570af302Sopenharmony_ci#include <stdio.h>
2570af302Sopenharmony_ci#include <stdlib.h>
3570af302Sopenharmony_ci#include <errno.h>
4570af302Sopenharmony_ci
5570af302Sopenharmony_ciint main(int argc, char *argv[])
6570af302Sopenharmony_ci{
7570af302Sopenharmony_ci	int i;
8570af302Sopenharmony_ci	float f;
9570af302Sopenharmony_ci	double d;
10570af302Sopenharmony_ci	long double ld;
11570af302Sopenharmony_ci	char *eptr;
12570af302Sopenharmony_ci
13570af302Sopenharmony_ci	for (i = 1; i < argc; i++) {
14570af302Sopenharmony_ci		errno = 0;
15570af302Sopenharmony_ci		f = strtof(argv[i], &eptr);
16570af302Sopenharmony_ci		printf("%a  (*eptr:%d errno:%d)\n", f, *eptr, errno);
17570af302Sopenharmony_ci		errno = 0;
18570af302Sopenharmony_ci		d = strtod(argv[i], &eptr);
19570af302Sopenharmony_ci		printf("%a  (*eptr:%d errno:%d)\n", d, *eptr, errno);
20570af302Sopenharmony_ci		errno = 0;
21570af302Sopenharmony_ci		ld = strtold(argv[i], &eptr);
22570af302Sopenharmony_ci		printf("%La  (*eptr:%d errno:%d)\n", ld, *eptr, errno);
23570af302Sopenharmony_ci	}
24570af302Sopenharmony_ci	return 0;
25570af302Sopenharmony_ci}
26

Indexes created Thu Nov 07 10:32:03 CST 2024