MCPcopy Create free account
hub / github.com/apache/arrow / StringToFloat

Function StringToFloat

cpp/src/arrow/util/value_parsing.cc:33–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31namespace internal {
32
33bool 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
44bool StringToFloat(const char* s, size_t length, char decimal_point, double* out) {
45 ::arrow_vendored::fast_float::parse_options options{

Callers 3

ConvertMethod · 0.85
ConvertMethod · 0.85
ConvertMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected