@@ -78,25 +78,37 @@ constexpr double constexptest() { return parse("3.1415 input"); }
7878#endif
7979
8080bool small () {
81- double result = -1 ;
82- std::string str = " 3e-1000" ;
83- auto r = fast_float::from_chars (str.data (), str.data () + str.size (), result);
84- if (r.ec != std::errc::result_out_of_range) { return false ; }
85- if (r.ptr != str.data () + 7 ) { return false ; }
86- if (result != 0 ) { return false ; }
81+ double result = -1 ;
82+ std::string str = " 3e-1000" ;
83+ auto r = fast_float::from_chars (str.data (), str.data () + str.size (), result);
84+ if (r.ec != std::errc::result_out_of_range) {
85+ return false ;
86+ }
87+ if (r.ptr != str.data () + 7 ) {
88+ return false ;
89+ }
90+ if (result != 0 ) {
91+ return false ;
92+ }
8793 printf (" small values go to zero\n " );
88- return true ;
94+ return true ;
8995}
9096
9197bool large () {
92- double result = -1 ;
93- std::string str = " 3e1000" ;
94- auto r = fast_float::from_chars (str.data (), str.data () + str.size (), result);
95- if (r.ec != std::errc::result_out_of_range) { return false ; }
96- if (r.ptr != str.data () + 6 ) { return false ; }
97- if (result != std::numeric_limits<double >::infinity ()) { return false ; }
98+ double result = -1 ;
99+ std::string str = " 3e1000" ;
100+ auto r = fast_float::from_chars (str.data (), str.data () + str.size (), result);
101+ if (r.ec != std::errc::result_out_of_range) {
102+ return false ;
103+ }
104+ if (r.ptr != str.data () + 6 ) {
105+ return false ;
106+ }
107+ if (result != std::numeric_limits<double >::infinity ()) {
108+ return false ;
109+ }
98110 printf (" large values go to infinity\n " );
99- return true ;
111+ return true ;
100112}
101113
102114int main () {
0 commit comments