| 31 | namespace internal { |
| 32 | |
| 33 | bool StringToFloat(const char* s, size_t length, char decimal_point, float* out) { |
| 34 | ::arrow_vendored::fast_float::parse_options options{ |
| 35 | ::arrow_vendored::fast_float::chars_format::general, decimal_point}; |
| 36 | const auto res = |
| 37 | ::arrow_vendored::fast_float::from_chars_advanced(s, s + length, *out, options); |
| 38 | const bool is_valid_number = |
| 39 | res.ec == std::errc() || res.ec == std::errc::result_out_of_range; |
| 40 | const bool consumed_entire_string = res.ptr == s + length; |
| 41 | return is_valid_number && consumed_entire_string; |
| 42 | } |
| 43 | |
| 44 | bool StringToFloat(const char* s, size_t length, char decimal_point, double* out) { |
| 45 | ::arrow_vendored::fast_float::parse_options options{ |