mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-06 08:46:49 +08:00
16 lines
338 B
C++
16 lines
338 B
C++
#include "fast_float/fast_float.h"
|
|
|
|
double get(const char *input) {
|
|
double result_value;
|
|
auto result =
|
|
fast_float::from_chars(input, input + strlen(input), result_value);
|
|
if (result.ec != std::errc()) {
|
|
return 10;
|
|
}
|
|
return result_value;
|
|
}
|
|
|
|
int main(int arg, char **argv) {
|
|
double x = get(argv[0]);
|
|
return int(x);
|
|
} |