diff options
author | pommicket <pommicket@gmail.com> | 2022-02-15 12:16:21 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-02-15 12:16:21 -0500 |
commit | 1ea9d85e3fdf3e90ceb46938c40bc4b1cfc09d89 (patch) | |
tree | 2bfaec112031ec46241f022ad7098000d7b837f1 /05/main.c | |
parent | f7c3154b8a0108ddeecdbd5afc3ac2c99124aab6 (diff) |
strtod
also fixed comparing strings
Diffstat (limited to '05/main.c')
-rw-r--r-- | 05/main.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -3,11 +3,11 @@ #include <string.h> int main(void) { - char s[] = " -0XAh.\n"; + char *s = "1.35984534e135-e12hello"; char *end; - errno = 0; - printf("%ld\n", strtol(s, &end, 0)); - printf("%d:%s",errno,end); + _Float f = _powers_of_10[-307]; + printf("%.15g\n",strtod(s, &end)); + printf("%s\n",end); return 0; } |