FloatImg4PythonBinding/funcs/t.c

37 lines
771 B
C

/*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pam.h>
#include "../floatimg.h"
/* --------------------------------------------------------------------- */
int main(int argc, char *argv[])
{
int foo;
double dval;
char *str;
str = "12.34"; dval = 0.0;
foo = parse_double(str, &dval);
printf("%-10s -> %3d %g\n", str, foo, dval);
str = "12e4"; dval = 0.0;
foo = parse_double(str, &dval);
printf("%-10s -> %3d %g\n", str, foo, dval);
str = "5s"; dval = 0.0;
foo = parse_double(str, &dval);
printf("%-10s -> %3d %g\n", str, foo, dval);
str = "PORN"; dval = 0.0;
foo = parse_double(str, &dval);
printf("%-10s -> %3d %g\n", str, foo, dval);
return 0;
}
/* --------------------------------------------------------------------- */