README.md: fix parse_number return type

This commit is contained in:
Marcin Wojdyr 2021-03-31 23:29:24 +02:00 committed by GitHub
parent 47d76a06f5
commit cf0f3daeaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,10 +27,10 @@ The current API is simple enough:
double x;
char * string = ...
bool isok = fast_double_parser::parse_number(string, &x);
const char * endptr = fast_double_parser::parse_number(string, &x);
```
You must check the value returned (`isok`): if it is `nullptr`, then the function refused to parse the input.
You must check the value returned (`endptr`): if it is `nullptr`, then the function refused to parse the input.
Otherwise, we return a pointer (`const char *`) to the end of the parsed string. The provided
pointer (`string`) should point at the beginning of the number: if you must skip whitespace characters,
it is your responsability to do so.