FloatImg/funcs/t.c

37 lines
771 B
C
Raw Normal View History

2019-09-12 19:48:12 +02:00
/*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pam.h>
#include "../floatimg.h"
/* --------------------------------------------------------------------- */
int main(int argc, char *argv[])
{
int foo;
2019-09-16 12:28:47 +02:00
double dval;
char *str;
str = "12.34"; dval = 0.0;
foo = parse_double(str, &dval);
printf("%-10s -> %3d %g\n", str, foo, dval);
2019-09-12 19:48:12 +02:00
2019-09-16 12:28:47 +02:00
str = "12e4"; dval = 0.0;
foo = parse_double(str, &dval);
printf("%-10s -> %3d %g\n", str, foo, dval);
2019-09-12 19:48:12 +02:00
2019-09-16 12:28:47 +02:00
str = "5s"; dval = 0.0;
foo = parse_double(str, &dval);
printf("%-10s -> %3d %g\n", str, foo, dval);
2019-09-13 14:34:56 +02:00
2019-09-16 12:28:47 +02:00
str = "PORN"; dval = 0.0;
foo = parse_double(str, &dval);
printf("%-10s -> %3d %g\n", str, foo, dval);
2019-09-12 19:48:12 +02:00
return 0;
}
/* --------------------------------------------------------------------- */