mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-07 01:06:48 +08:00
Merge branch 'main' of https://github.com/IRainman/fast_float
This commit is contained in:
commit
a2d81d42ee
@ -386,8 +386,7 @@ the code size and improve performance:
|
|||||||
int main() {
|
int main() {
|
||||||
std::string input = "23.14069263277926900572";
|
std::string input = "23.14069263277926900572";
|
||||||
double result;
|
double result;
|
||||||
fast_float::parse_options options{chars_format::allow_leading_plus | chars_format::skip_white_space};
|
auto answer = fast_float::from_chars(input.data(), input.data() + input.size(), result);
|
||||||
auto answer = fast_float::from_chars_advanced(input.data(), input.data() + input.size(), result, options);
|
|
||||||
if ((answer.ec != std::errc()) || ((result != 23.14069263277927 /*properly rounded value */)))
|
if ((answer.ec != std::errc()) || ((result != 23.14069263277927 /*properly rounded value */)))
|
||||||
{ std::cerr << "parsing failure\n"; return EXIT_FAILURE; }
|
{ std::cerr << "parsing failure\n"; return EXIT_FAILURE; }
|
||||||
input = "-23.14069263277926900572";
|
input = "-23.14069263277926900572";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user