From 1ea9d85e3fdf3e90ceb46938c40bc4b1cfc09d89 Mon Sep 17 00:00:00 2001 From: pommicket Date: Tue, 15 Feb 2022 12:16:21 -0500 Subject: strtod also fixed comparing strings --- 05/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to '05/main.c') diff --git a/05/main.c b/05/main.c index 6b7aac7..7b5789c 100644 --- a/05/main.c +++ b/05/main.c @@ -3,11 +3,11 @@ #include 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; } -- cgit v1.2.3