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