mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-07 01:06:48 +08:00
Update README.md
This commit is contained in:
parent
67aeda07ad
commit
82477e9310
@ -386,7 +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;
|
||||||
auto answer = fast_float::from_chars_advanced(input.data(), input.data() + input.size(), result);
|
auto answer = fast_float::from_chars(input.data(), input.data() + input.size(), result);
|
||||||
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