tests/bloat_analysis/main_ref.cpp
raw| 1 | #include "fast_float/fast_float.h" |
| 2 | |
| 3 | double get(char const *input) { |
| 4 | double result_value; |
| 5 | auto result = |
| 6 | fast_float::from_chars(input, input + strlen(input), result_value); |
| 7 | if (result.ec != std::errc()) { |
| 8 | return 10; |
| 9 | } |
| 10 | return result_value; |
| 11 | } |
| 12 | |
| 13 | int main(int arg, char **argv) { |
| 14 | double x = get(argv[0]); |
| 15 | return int(x); |
| 16 | } |