mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-08 01:36:49 +08:00
Merge pull request #11 from lemire/dlemire/adding_a_test
adding a test/fixing readme
This commit is contained in:
commit
3eb956c757
@ -44,7 +44,7 @@ It will parse infinity and nan values.
|
||||
Example:
|
||||
|
||||
``` C++
|
||||
#include "fast_float/parse_number.h"
|
||||
#include "fast_float/fast_float.h"
|
||||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
@ -53,6 +53,7 @@ int main() {
|
||||
auto answer = fast_float::from_chars(input.data(), input.data()+input.size(), result);
|
||||
if(answer.ec != std::errc()) { std::cerr << "parsing failure\n"; return EXIT_FAILURE; }
|
||||
std::cout << "parsed the number " << result << std::endl;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -110,6 +110,7 @@ int main() {
|
||||
|
||||
|
||||
std::cout << "======= 64 bits " << std::endl;
|
||||
Assert(basic_test_64bit("1.0000000000000006661338147750939242541790008544921875",1.0000000000000007));
|
||||
Assert(basic_test_64bit("1090544144181609348835077142190",0x1.b8779f2474dfbp+99));
|
||||
Assert(basic_test_64bit("2.2250738585072013e-308",2.2250738585072013e-308));
|
||||
Assert(basic_test_64bit("-92666518056446206563E3", -92666518056446206563E3));
|
||||
|
||||
@ -8,4 +8,5 @@ int main() {
|
||||
auto answer = fast_float::from_chars(input.data(), input.data()+input.size(), result);
|
||||
if(answer.ec != std::errc()) { std::cerr << "parsing failure\n"; return EXIT_FAILURE; }
|
||||
std::cout << "parsed the number " << result << std::endl;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user