Download test/unit/test_string/test_atof.c from camenduru/pocketsphinx: direct link, hf CLI and curl.
- Browser
- Download file 834 Bytes
-
https://huggingface.co/camenduru/pocketsphinx/resolve/main/test/unit/test_string/test_atof.c
- Command line
-
hf download hf://camenduru/pocketsphinx/test/unit/test_string/test_atof.c
-
curl -L -o test_atof.c https://huggingface.co/camenduru/pocketsphinx/resolve/main/test/unit/test_string/test_atof.c
834 Bytes
| int | |
| main(int argc, char *argv[]) | |
| { | |
| double foo; | |
| (void)argc; | |
| (void)argv; | |
| /* Ensure that it's really locale-independent. */ | |
| if (setlocale(LC_ALL, "fr_CA.UTF-8") == NULL) | |
| fprintf(stderr, "Note: setlocale(LC_ALL, fr_CA.UTF-8) failed\n"); | |
| foo = atof("1.5324523524523423"); | |
| printf("atof(): 1.5324523524523423 %f\n", foo); | |
| foo = atof_c("1.5324523524523423"); | |
| printf("1.5324523524523423 %f\n", foo); | |
| if (fabs(foo - 1.532) > 0.01) | |
| return 1; | |
| foo = atof_c("5e-3"); | |
| printf("5e-3 %f\n", foo); | |
| if (fabs(foo - 0.005) > 0.01) | |
| return 1; | |
| foo = atof_c("1.2e+2"); | |
| printf("1.2e+2 %f\n", foo); | |
| if (fabs(foo - 120.0) > 0.01) | |
| return 1; | |
| foo = atof_c("1e-80"); | |
| printf("1e-80 %g\n", foo); | |
| return 0; | |
| } | |