<charconv>: fix from_chars("0.fffffffffffff8p-1022") (#934)

Fixes #931.
This commit is contained in:
statementreply 2020-08-18 08:45:53 +08:00 коммит произвёл GitHub
Родитель e7451b3f9d
Коммит 9fb6caa54c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 624 добавлений и 3 удалений

Просмотреть файл

@ -1327,9 +1327,11 @@ _NODISCARD errc _Assemble_floating_point_value(const uint64_t _Initial_mantissa,
// We detect this case here and re-adjust the mantissa and exponent appropriately, to form a normal number:
if (_Mantissa > _Traits::_Denormal_mantissa_mask) {
// We add one to the _Denormal_mantissa_shift to account for the hidden mantissa bit
// (we subtracted one to account for this bit when we computed the _Denormal_mantissa_shift above).
_Exponent = _Initial_exponent - (_Denormal_mantissa_shift + 1) - _Normal_mantissa_shift;
// The mantissa is already in the correct position for a normal value. (The carried over bit when we
// added 1 to round the mantissa is in the correct position for the hidden bit.)
// _Denormal_mantissa_shift is the actual number of bits by which we have shifted the mantissa into its
// final position.
_Exponent = _Initial_exponent - _Denormal_mantissa_shift;
}
} else {
_Mantissa <<= _Denormal_mantissa_shift;

Просмотреть файл

@ -1140,4 +1140,502 @@ inline constexpr DoubleFromCharsTestCase double_from_chars_test_cases[] = {
{"1e-9999", chars_format::scientific, 7, errc::result_out_of_range, 0.0},
{"10e+5199", chars_format::scientific, 8, errc::result_out_of_range, double_inf},
{"0.001e-5199", chars_format::scientific, 11, errc::result_out_of_range, 0.0},
// GH-931 "<charconv>: hex from_chars(\"0.fffffffffffff8p-1022\") is incorrect"
// Test cases for values close to std::numeric_limits<double>::min() and std::numeric_limits<double>::max()
{"0.fffffffffffffp-1022", chars_format::hex, 21, errc{}, 0x0.fffffffffffffp-1022},
{"1.0000000000000p-1022", chars_format::hex, 21, errc{}, 0x1.0000000000000p-1022},
{"1.ffffffffffffep-1023", chars_format::hex, 21, errc{}, 0x0.fffffffffffffp-1022},
{"1.fffffffffffffp-1023", chars_format::hex, 21, errc{}, 0x1.0000000000000p-1022},
{"2.0000000000000p-1023", chars_format::hex, 21, errc{}, 0x1.0000000000000p-1022},
{"3.ffffffffffffcp-1024", chars_format::hex, 21, errc{}, 0x0.fffffffffffffp-1022},
{"3.ffffffffffffdp-1024", chars_format::hex, 21, errc{}, 0x0.fffffffffffffp-1022},
{"3.ffffffffffffep-1024", chars_format::hex, 21, errc{}, 0x1.0000000000000p-1022},
{"3.fffffffffffffp-1024", chars_format::hex, 21, errc{}, 0x1.0000000000000p-1022},
{"4.0000000000000p-1024", chars_format::hex, 21, errc{}, 0x1.0000000000000p-1022},
{"7.ffffffffffff8p-1025", chars_format::hex, 21, errc{}, 0x0.fffffffffffffp-1022},
{"7.ffffffffffff9p-1025", chars_format::hex, 21, errc{}, 0x0.fffffffffffffp-1022},
{"7.ffffffffffffbp-1025", chars_format::hex, 21, errc{}, 0x0.fffffffffffffp-1022},
{"7.ffffffffffffcp-1025", chars_format::hex, 21, errc{}, 0x1.0000000000000p-1022},
{"7.ffffffffffffdp-1025", chars_format::hex, 21, errc{}, 0x1.0000000000000p-1022},
{"7.ffffffffffffep-1025", chars_format::hex, 21, errc{}, 0x1.0000000000000p-1022},
{"7.fffffffffffffp-1025", chars_format::hex, 21, errc{}, 0x1.0000000000000p-1022},
{"8.0000000000000p-1025", chars_format::hex, 21, errc{}, 0x1.0000000000000p-1022},
{"0.fffffffffffff0p-1022", chars_format::hex, 22, errc{}, 0x0.fffffffffffffp-1022},
{"0.fffffffffffff1p-1022", chars_format::hex, 22, errc{}, 0x0.fffffffffffffp-1022},
{"0.fffffffffffff7p-1022", chars_format::hex, 22, errc{}, 0x0.fffffffffffffp-1022},
{"0.fffffffffffff8p-1022", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"0.fffffffffffff9p-1022", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"0.fffffffffffffbp-1022", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"0.fffffffffffffcp-1022", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"0.fffffffffffffdp-1022", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"0.ffffffffffffffp-1022", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"1.00000000000000p-1022", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"1.ffffffffffffe0p-1023", chars_format::hex, 22, errc{}, 0x0.fffffffffffffp-1022},
{"1.ffffffffffffe1p-1023", chars_format::hex, 22, errc{}, 0x0.fffffffffffffp-1022},
{"1.ffffffffffffefp-1023", chars_format::hex, 22, errc{}, 0x0.fffffffffffffp-1022},
{"1.fffffffffffff0p-1023", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"1.fffffffffffff1p-1023", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"1.fffffffffffff7p-1023", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"1.fffffffffffff8p-1023", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"1.fffffffffffff9p-1023", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"1.ffffffffffffffp-1023", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"2.00000000000000p-1023", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"3.ffffffffffffc0p-1024", chars_format::hex, 22, errc{}, 0x0.fffffffffffffp-1022},
{"3.ffffffffffffc1p-1024", chars_format::hex, 22, errc{}, 0x0.fffffffffffffp-1022},
{"3.ffffffffffffdfp-1024", chars_format::hex, 22, errc{}, 0x0.fffffffffffffp-1022},
{"3.ffffffffffffe0p-1024", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"3.ffffffffffffe1p-1024", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"3.ffffffffffffefp-1024", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"3.fffffffffffff0p-1024", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"3.fffffffffffff1p-1024", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"3.ffffffffffffffp-1024", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"4.00000000000000p-1024", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"7.ffffffffffff80p-1025", chars_format::hex, 22, errc{}, 0x0.fffffffffffffp-1022},
{"7.ffffffffffff81p-1025", chars_format::hex, 22, errc{}, 0x0.fffffffffffffp-1022},
{"7.ffffffffffffbfp-1025", chars_format::hex, 22, errc{}, 0x0.fffffffffffffp-1022},
{"7.ffffffffffffc0p-1025", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"7.ffffffffffffc1p-1025", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"7.ffffffffffffdfp-1025", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"7.ffffffffffffe0p-1025", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"7.ffffffffffffe1p-1025", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"7.ffffffffffffffp-1025", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"8.00000000000000p-1025", chars_format::hex, 22, errc{}, 0x1.0000000000000p-1022},
{"1.fffffffffffffp+1023", chars_format::hex, 21, errc{}, 0x1.fffffffffffffp+1023},
{"2.0000000000000p+1023", chars_format::hex, 21, errc::result_out_of_range, double_inf},
{"3.ffffffffffffep+1022", chars_format::hex, 21, errc{}, 0x1.fffffffffffffp+1023},
{"3.fffffffffffffp+1022", chars_format::hex, 21, errc::result_out_of_range, double_inf},
{"4.0000000000000p+1022", chars_format::hex, 21, errc::result_out_of_range, double_inf},
{"7.ffffffffffffcp+1021", chars_format::hex, 21, errc{}, 0x1.fffffffffffffp+1023},
{"7.ffffffffffffdp+1021", chars_format::hex, 21, errc{}, 0x1.fffffffffffffp+1023},
{"7.ffffffffffffep+1021", chars_format::hex, 21, errc::result_out_of_range, double_inf},
{"7.fffffffffffffp+1021", chars_format::hex, 21, errc::result_out_of_range, double_inf},
{"8.0000000000000p+1021", chars_format::hex, 21, errc::result_out_of_range, double_inf},
{"0.fffffffffffff8p+1024", chars_format::hex, 22, errc{}, 0x1.fffffffffffffp+1023},
{"0.fffffffffffff9p+1024", chars_format::hex, 22, errc{}, 0x1.fffffffffffffp+1023},
{"0.fffffffffffffbp+1024", chars_format::hex, 22, errc{}, 0x1.fffffffffffffp+1023},
{"0.fffffffffffffcp+1024", chars_format::hex, 22, errc::result_out_of_range, double_inf},
{"0.fffffffffffffdp+1024", chars_format::hex, 22, errc::result_out_of_range, double_inf},
{"0.ffffffffffffffp+1024", chars_format::hex, 22, errc::result_out_of_range, double_inf},
{"1.00000000000000p+1024", chars_format::hex, 22, errc::result_out_of_range, double_inf},
{"1.fffffffffffff0p+1023", chars_format::hex, 22, errc{}, 0x1.fffffffffffffp+1023},
{"1.fffffffffffff1p+1023", chars_format::hex, 22, errc{}, 0x1.fffffffffffffp+1023},
{"1.fffffffffffff7p+1023", chars_format::hex, 22, errc{}, 0x1.fffffffffffffp+1023},
{"1.fffffffffffff8p+1023", chars_format::hex, 22, errc::result_out_of_range, double_inf},
{"1.fffffffffffff9p+1023", chars_format::hex, 22, errc::result_out_of_range, double_inf},
{"1.ffffffffffffffp+1023", chars_format::hex, 22, errc::result_out_of_range, double_inf},
{"2.00000000000000p+1023", chars_format::hex, 22, errc::result_out_of_range, double_inf},
{"3.ffffffffffffe0p+1022", chars_format::hex, 22, errc{}, 0x1.fffffffffffffp+1023},
{"3.ffffffffffffe1p+1022", chars_format::hex, 22, errc{}, 0x1.fffffffffffffp+1023},
{"3.ffffffffffffefp+1022", chars_format::hex, 22, errc{}, 0x1.fffffffffffffp+1023},
{"3.fffffffffffff0p+1022", chars_format::hex, 22, errc::result_out_of_range, double_inf},
{"3.fffffffffffff1p+1022", chars_format::hex, 22, errc::result_out_of_range, double_inf},
{"3.ffffffffffffffp+1022", chars_format::hex, 22, errc::result_out_of_range, double_inf},
{"4.00000000000000p+1022", chars_format::hex, 22, errc::result_out_of_range, double_inf},
{"7.ffffffffffffc0p+1021", chars_format::hex, 22, errc{}, 0x1.fffffffffffffp+1023},
{"7.ffffffffffffc1p+1021", chars_format::hex, 22, errc{}, 0x1.fffffffffffffp+1023},
{"7.ffffffffffffdfp+1021", chars_format::hex, 22, errc{}, 0x1.fffffffffffffp+1023},
{"7.ffffffffffffe0p+1021", chars_format::hex, 22, errc::result_out_of_range, double_inf},
{"7.ffffffffffffe1p+1021", chars_format::hex, 22, errc::result_out_of_range, double_inf},
{"7.ffffffffffffffp+1021", chars_format::hex, 22, errc::result_out_of_range, double_inf},
{"8.00000000000000p+1021", chars_format::hex, 22, errc::result_out_of_range, double_inf},
{"0.fffffffffffff80p+1024", chars_format::hex, 23, errc{}, 0x1.fffffffffffffp+1023},
{"0.fffffffffffff81p+1024", chars_format::hex, 23, errc{}, 0x1.fffffffffffffp+1023},
{"0.fffffffffffffbfp+1024", chars_format::hex, 23, errc{}, 0x1.fffffffffffffp+1023},
{"0.fffffffffffffc0p+1024", chars_format::hex, 23, errc::result_out_of_range, double_inf},
{"0.fffffffffffffc1p+1024", chars_format::hex, 23, errc::result_out_of_range, double_inf},
{"0.fffffffffffffffp+1024", chars_format::hex, 23, errc::result_out_of_range, double_inf},
{"1.000000000000000p+1024", chars_format::hex, 23, errc::result_out_of_range, double_inf},
// (0 + 1 - 2 * 2^-53) * 2^-1022 exactly
{"2."
"22507385850720088902458687608585988765042311224095946549352480256244000922823569517877588880375915526423097809504"
"34312085877387158357291821993020294379224223559819827501242041788969571311791082261043971979604000454897391938079"
"19893608152561311337614984204327175103362739154978273159414382813627511383860409424946494228631669542910508020181"
"59266421349966065178030950759130587198464239060686371020051087232827846788436319445158661350412234790147923695852"
"08321597621066375401613736583044193603714778355306682834535634005074073040135602968046375918583163124224521599262"
"54649430083685186171942241764645513713542013221703137049658321015465406803539741790602258950302350193751977303094"
"5763173210852507299305089761582519159720757232455434770912461317493580281734466552734375e-308",
chars_format::scientific, 773, errc{}, 0x0.fffffffffffffp-1022},
// (0 + 1 - 2 * 2^-53) * 2^-1022 exactly, followed by a thousand 0 digits
{"2."
"22507385850720088902458687608585988765042311224095946549352480256244000922823569517877588880375915526423097809504"
"34312085877387158357291821993020294379224223559819827501242041788969571311791082261043971979604000454897391938079"
"19893608152561311337614984204327175103362739154978273159414382813627511383860409424946494228631669542910508020181"
"59266421349966065178030950759130587198464239060686371020051087232827846788436319445158661350412234790147923695852"
"08321597621066375401613736583044193603714778355306682834535634005074073040135602968046375918583163124224521599262"
"54649430083685186171942241764645513713542013221703137049658321015465406803539741790602258950302350193751977303094"
"57631732108525072993050897615825191597207572324554347709124613174935802817344665527343750000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000e-308",
chars_format::scientific, 1773, errc{}, 0x0.fffffffffffffp-1022},
// above (0 + 1 - 2 * 2^-53) * 2^-1022, appended a thousand 0 digits followed by a 1 digit
{"2."
"22507385850720088902458687608585988765042311224095946549352480256244000922823569517877588880375915526423097809504"
"34312085877387158357291821993020294379224223559819827501242041788969571311791082261043971979604000454897391938079"
"19893608152561311337614984204327175103362739154978273159414382813627511383860409424946494228631669542910508020181"
"59266421349966065178030950759130587198464239060686371020051087232827846788436319445158661350412234790147923695852"
"08321597621066375401613736583044193603714778355306682834535634005074073040135602968046375918583163124224521599262"
"54649430083685186171942241764645513713542013221703137049658321015465406803539741790602258950302350193751977303094"
"57631732108525072993050897615825191597207572324554347709124613174935802817344665527343750000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"000000000000000000000000000000000000000000000000000000000000000000000001e-308",
chars_format::scientific, 1774, errc{}, 0x0.fffffffffffffp-1022},
// above (0 + 1 - 2 * 2^-53) * 2^-1022: appended a 1 digit
{"2."
"22507385850720088902458687608585988765042311224095946549352480256244000922823569517877588880375915526423097809504"
"34312085877387158357291821993020294379224223559819827501242041788969571311791082261043971979604000454897391938079"
"19893608152561311337614984204327175103362739154978273159414382813627511383860409424946494228631669542910508020181"
"59266421349966065178030950759130587198464239060686371020051087232827846788436319445158661350412234790147923695852"
"08321597621066375401613736583044193603714778355306682834535634005074073040135602968046375918583163124224521599262"
"54649430083685186171942241764645513713542013221703137049658321015465406803539741790602258950302350193751977303094"
"57631732108525072993050897615825191597207572324554347709124613174935802817344665527343751e-308",
chars_format::scientific, 774, errc{}, 0x0.fffffffffffffp-1022},
// above (0 + 1 - 2 * 2^-53) * 2^-1022: incremented last digit
{"2."
"22507385850720088902458687608585988765042311224095946549352480256244000922823569517877588880375915526423097809504"
"34312085877387158357291821993020294379224223559819827501242041788969571311791082261043971979604000454897391938079"
"19893608152561311337614984204327175103362739154978273159414382813627511383860409424946494228631669542910508020181"
"59266421349966065178030950759130587198464239060686371020051087232827846788436319445158661350412234790147923695852"
"08321597621066375401613736583044193603714778355306682834535634005074073040135602968046375918583163124224521599262"
"54649430083685186171942241764645513713542013221703137049658321015465406803539741790602258950302350193751977303094"
"5763173210852507299305089761582519159720757232455434770912461317493580281734466552734376e-308",
chars_format::scientific, 773, errc{}, 0x0.fffffffffffffp-1022},
// below (0 + 1 - 2^-53) * 2^-1022: decremented last digit, then appended three 9 digits
{"2."
"22507385850720113605740979670913197593481954635164564802342610972482222202107694551652952390813508791414915891303"
"96211068700864386945946455276572074078206217433799881410632673292535522868813721490129811224514518898490572223072"
"85255133155755015914397476397983411801999323962548289017107081850690630666655994938275772572015763062690663332647"
"56530000924588831643303777979186961204949739037782970490505108060994073026293712895895000358379996720725430436028"
"40788957717961509455167482434710307026091446215722898802581825451803257070188608721131280795122334262883686223215"
"03775666622503982534335974568884423900265498198385487948292206894721689831099698365846814022854243330660339850886"
"44580400103493397042756718644338377048603786162277173854562306587467901408672332763671874999e-308",
chars_format::scientific, 777, errc{}, 0x0.fffffffffffffp-1022},
// (0 + 1 - 2^-53) * 2^-1022 exactly
{"2."
"22507385850720113605740979670913197593481954635164564802342610972482222202107694551652952390813508791414915891303"
"96211068700864386945946455276572074078206217433799881410632673292535522868813721490129811224514518898490572223072"
"85255133155755015914397476397983411801999323962548289017107081850690630666655994938275772572015763062690663332647"
"56530000924588831643303777979186961204949739037782970490505108060994073026293712895895000358379996720725430436028"
"40788957717961509455167482434710307026091446215722898802581825451803257070188608721131280795122334262883686223215"
"03775666622503982534335974568884423900265498198385487948292206894721689831099698365846814022854243330660339850886"
"44580400103493397042756718644338377048603786162277173854562306587467901408672332763671875e-308",
chars_format::scientific, 774, errc{}, 0x1.0000000000000p-1022},
// (0 + 1 - 2^-53) * 2^-1022 exactly, followed by a thousand 0 digits
{"2."
"22507385850720113605740979670913197593481954635164564802342610972482222202107694551652952390813508791414915891303"
"96211068700864386945946455276572074078206217433799881410632673292535522868813721490129811224514518898490572223072"
"85255133155755015914397476397983411801999323962548289017107081850690630666655994938275772572015763062690663332647"
"56530000924588831643303777979186961204949739037782970490505108060994073026293712895895000358379996720725430436028"
"40788957717961509455167482434710307026091446215722898802581825451803257070188608721131280795122334262883686223215"
"03775666622503982534335974568884423900265498198385487948292206894721689831099698365846814022854243330660339850886"
"44580400103493397042756718644338377048603786162277173854562306587467901408672332763671875000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"000000000000000000000000000000000000000000000000000000000000000000000000e-308",
chars_format::scientific, 1774, errc{}, 0x1.0000000000000p-1022},
// above (0 + 1 - 2^-53) * 2^-1022: append a thousand 0 digits followed by a 1 digit
{"2."
"22507385850720113605740979670913197593481954635164564802342610972482222202107694551652952390813508791414915891303"
"96211068700864386945946455276572074078206217433799881410632673292535522868813721490129811224514518898490572223072"
"85255133155755015914397476397983411801999323962548289017107081850690630666655994938275772572015763062690663332647"
"56530000924588831643303777979186961204949739037782970490505108060994073026293712895895000358379996720725430436028"
"40788957717961509455167482434710307026091446215722898802581825451803257070188608721131280795122334262883686223215"
"03775666622503982534335974568884423900265498198385487948292206894721689831099698365846814022854243330660339850886"
"44580400103493397042756718644338377048603786162277173854562306587467901408672332763671875000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000000000000001e-308",
chars_format::scientific, 1775, errc{}, 0x1.0000000000000p-1022},
// above (0 + 1 - 2^-53) * 2^-1022: appended a 1 digit
{"2."
"22507385850720113605740979670913197593481954635164564802342610972482222202107694551652952390813508791414915891303"
"96211068700864386945946455276572074078206217433799881410632673292535522868813721490129811224514518898490572223072"
"85255133155755015914397476397983411801999323962548289017107081850690630666655994938275772572015763062690663332647"
"56530000924588831643303777979186961204949739037782970490505108060994073026293712895895000358379996720725430436028"
"40788957717961509455167482434710307026091446215722898802581825451803257070188608721131280795122334262883686223215"
"03775666622503982534335974568884423900265498198385487948292206894721689831099698365846814022854243330660339850886"
"445804001034933970427567186443383770486037861622771738545623065874679014086723327636718751e-308",
chars_format::scientific, 775, errc{}, 0x1.0000000000000p-1022},
// above (0 + 1 - 2^-53) * 2^-1022: incremented last digit
{"2."
"22507385850720113605740979670913197593481954635164564802342610972482222202107694551652952390813508791414915891303"
"96211068700864386945946455276572074078206217433799881410632673292535522868813721490129811224514518898490572223072"
"85255133155755015914397476397983411801999323962548289017107081850690630666655994938275772572015763062690663332647"
"56530000924588831643303777979186961204949739037782970490505108060994073026293712895895000358379996720725430436028"
"40788957717961509455167482434710307026091446215722898802581825451803257070188608721131280795122334262883686223215"
"03775666622503982534335974568884423900265498198385487948292206894721689831099698365846814022854243330660339850886"
"44580400103493397042756718644338377048603786162277173854562306587467901408672332763671876e-308",
chars_format::scientific, 774, errc{}, 0x1.0000000000000p-1022},
// below (0 + 1 - 0.5 * 2^-53) * 2^-1022: decremented last digit, then appended three 9 digits
{"2."
"22507385850720125957382125702076802007701776340698873928837676330601332841749757068540634146032305423910824932203"
"77160560112603001240273771918347963927697214370789908365327989044318498647325041104672730846969778120287162365569"
"67935895657351868202788722494811530151317616366333296945953431369222190308053787694940411743707809822580740988880"
"55161790711900214875940191589215148208192489026331270225732118475077186145222409621263169862363877686014183806116"
"57022637766409076481944355360543363737279780145931006786604921175167849085215111597673733233391919832213268535191"
"28338784891913380715532840971003878993627240686726663397609149834349831344879676653469091559130189899114521124782"
"380547341009775590676096291585949697743018930811385869272811532937339507043361663818359374999e-308",
chars_format::scientific, 778, errc{}, 0x1.0000000000000p-1022},
// (0 + 1 - 0.5 * 2^-53) * 2^-1022 exactly
{"2."
"22507385850720125957382125702076802007701776340698873928837676330601332841749757068540634146032305423910824932203"
"77160560112603001240273771918347963927697214370789908365327989044318498647325041104672730846969778120287162365569"
"67935895657351868202788722494811530151317616366333296945953431369222190308053787694940411743707809822580740988880"
"55161790711900214875940191589215148208192489026331270225732118475077186145222409621263169862363877686014183806116"
"57022637766409076481944355360543363737279780145931006786604921175167849085215111597673733233391919832213268535191"
"28338784891913380715532840971003878993627240686726663397609149834349831344879676653469091559130189899114521124782"
"380547341009775590676096291585949697743018930811385869272811532937339507043361663818359375e-308",
chars_format::scientific, 775, errc{}, 0x1.0000000000000p-1022},
// (0 + 1 - 0.5 * 2^-53) * 2^-1022 exactly, followed by a thousand 0 digits
{"2."
"22507385850720125957382125702076802007701776340698873928837676330601332841749757068540634146032305423910824932203"
"77160560112603001240273771918347963927697214370789908365327989044318498647325041104672730846969778120287162365569"
"67935895657351868202788722494811530151317616366333296945953431369222190308053787694940411743707809822580740988880"
"55161790711900214875940191589215148208192489026331270225732118475077186145222409621263169862363877686014183806116"
"57022637766409076481944355360543363737279780145931006786604921175167849085215111597673733233391919832213268535191"
"28338784891913380715532840971003878993627240686726663397609149834349831344879676653469091559130189899114521124782"
"38054734100977559067609629158594969774301893081138586927281153293733950704336166381835937500000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000000000000000e-308",
chars_format::scientific, 1775, errc{}, 0x1.0000000000000p-1022},
// above (0 + 1 - 0.5 * 2^-53) * 2^-1022: append a thousand 0 digits followed by a 1 digit
{"2."
"22507385850720125957382125702076802007701776340698873928837676330601332841749757068540634146032305423910824932203"
"77160560112603001240273771918347963927697214370789908365327989044318498647325041104672730846969778120287162365569"
"67935895657351868202788722494811530151317616366333296945953431369222190308053787694940411743707809822580740988880"
"55161790711900214875940191589215148208192489026331270225732118475077186145222409621263169862363877686014183806116"
"57022637766409076481944355360543363737279780145931006786604921175167849085215111597673733233391919832213268535191"
"28338784891913380715532840971003878993627240686726663397609149834349831344879676653469091559130189899114521124782"
"38054734100977559067609629158594969774301893081138586927281153293733950704336166381835937500000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000001e-308",
chars_format::scientific, 1776, errc{}, 0x1.0000000000000p-1022},
// above (0 + 1 - 0.5 * 2^-53) * 2^-1022: appended a 1 digit
{"2."
"22507385850720125957382125702076802007701776340698873928837676330601332841749757068540634146032305423910824932203"
"77160560112603001240273771918347963927697214370789908365327989044318498647325041104672730846969778120287162365569"
"67935895657351868202788722494811530151317616366333296945953431369222190308053787694940411743707809822580740988880"
"55161790711900214875940191589215148208192489026331270225732118475077186145222409621263169862363877686014183806116"
"57022637766409076481944355360543363737279780145931006786604921175167849085215111597673733233391919832213268535191"
"28338784891913380715532840971003878993627240686726663397609149834349831344879676653469091559130189899114521124782"
"3805473410097755906760962915859496977430189308113858692728115329373395070433616638183593751e-308",
chars_format::scientific, 776, errc{}, 0x1.0000000000000p-1022},
// above (0 + 1 - 0.5 * 2^-53) * 2^-1022: incremented last digit
{"2."
"22507385850720125957382125702076802007701776340698873928837676330601332841749757068540634146032305423910824932203"
"77160560112603001240273771918347963927697214370789908365327989044318498647325041104672730846969778120287162365569"
"67935895657351868202788722494811530151317616366333296945953431369222190308053787694940411743707809822580740988880"
"55161790711900214875940191589215148208192489026331270225732118475077186145222409621263169862363877686014183806116"
"57022637766409076481944355360543363737279780145931006786604921175167849085215111597673733233391919832213268535191"
"28338784891913380715532840971003878993627240686726663397609149834349831344879676653469091559130189899114521124782"
"380547341009775590676096291585949697743018930811385869272811532937339507043361663818359376e-308",
chars_format::scientific, 775, errc{}, 0x1.0000000000000p-1022},
// below 1 * 2^-1022: decremented last digit, then appended three 9 digits
{"2."
"22507385850720138309023271733240406421921598046233183055332741688720443481391819585428315901251102056406733973103"
"58110051524341615534601088560123853777188211307779935320023304796101474425836360719215650469425037342083752508066"
"50616658158948720491179968591639648500635908770118304874799780887753749949451580451605050915399856582470818645113"
"53793580499211598108576605199243335211435239014879569960959128889160299264151106346631339366347758651302937176204"
"73256317814856643508721228286376420448468114076139114770628016898532441100241614474216185671661505401542850847167"
"52901903161322778896729707373123334086988983175067838846926092773977972858659654941091369095406136467568702398678"
"315290680984617210924625396728515624999e-308",
chars_format::scientific, 724, errc{}, 0x1.0000000000000p-1022},
// 1 * 2^-1022 exactly
{"2."
"22507385850720138309023271733240406421921598046233183055332741688720443481391819585428315901251102056406733973103"
"58110051524341615534601088560123853777188211307779935320023304796101474425836360719215650469425037342083752508066"
"50616658158948720491179968591639648500635908770118304874799780887753749949451580451605050915399856582470818645113"
"53793580499211598108576605199243335211435239014879569960959128889160299264151106346631339366347758651302937176204"
"73256317814856643508721228286376420448468114076139114770628016898532441100241614474216185671661505401542850847167"
"52901903161322778896729707373123334086988983175067838846926092773977972858659654941091369095406136467568702398678"
"315290680984617210924625396728515625e-308",
chars_format::scientific, 721, errc{}, 0x1.0000000000000p-1022},
// (1 + 1 - 2 * 2^-53) * 2^1023 exactly
{"17976931348623157081452742373170435679807056752584499659891747680315726078002853876058955863276687817154045895351"
"43824642343213268894641827684675467035375169860499105765512820762454900903893289440758685084551339423045832369032"
"22948165808559332123348274797826204144723168738177180919299881250404026184124858368",
chars_format::fixed, 309, errc{}, 0x1.fffffffffffffp+1023},
// (1 + 1 - 2 * 2^-53) * 2^1023 exactly, followed by a thousand 0 digits
{"17976931348623157081452742373170435679807056752584499659891747680315726078002853876058955863276687817154045895351"
"43824642343213268894641827684675467035375169860499105765512820762454900903893289440758685084551339423045832369032"
"22948165808559332123348274797826204144723168738177180919299881250404026184124858368."
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
chars_format::fixed, 1310, errc{}, 0x1.fffffffffffffp+1023},
// above (1 + 1 - 2 * 2^-53) * 2^1023, appended a thousand 0 digits followed by a 1 digit
{"17976931348623157081452742373170435679807056752584499659891747680315726078002853876058955863276687817154045895351"
"43824642343213268894641827684675467035375169860499105765512820762454900903893289440758685084551339423045832369032"
"22948165808559332123348274797826204144723168738177180919299881250404026184124858368."
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
chars_format::fixed, 1311, errc{}, 0x1.fffffffffffffp+1023},
// above (1 + 1 - 2 * 2^-53) * 2^1023: appended a 1 digit
{"17976931348623157081452742373170435679807056752584499659891747680315726078002853876058955863276687817154045895351"
"43824642343213268894641827684675467035375169860499105765512820762454900903893289440758685084551339423045832369032"
"22948165808559332123348274797826204144723168738177180919299881250404026184124858368.1",
chars_format::fixed, 311, errc{}, 0x1.fffffffffffffp+1023},
// above (1 + 1 - 2 * 2^-53) * 2^1023: incremented last digit
{"17976931348623157081452742373170435679807056752584499659891747680315726078002853876058955863276687817154045895351"
"43824642343213268894641827684675467035375169860499105765512820762454900903893289440758685084551339423045832369032"
"22948165808559332123348274797826204144723168738177180919299881250404026184124858369",
chars_format::fixed, 309, errc{}, 0x1.fffffffffffffp+1023},
// below (1 + 1 - 2^-53) * 2^1023: decremented last digit, then appended three 9 digits
{"17976931348623158079372897140530341507993413271003782693617377898044496829276475094664901797758720709633028641669"
"28879109465555478519404026306574886715058206819089020007083836762738548458177115317644757302700698555713669596228"
"42914819860834936475292719074168444365510704342711559699508093042880177904174497791.999",
chars_format::fixed, 313, errc{}, 0x1.fffffffffffffp+1023},
// (1 + 1 - 2^-53) * 2^1023 exactly
{"17976931348623158079372897140530341507993413271003782693617377898044496829276475094664901797758720709633028641669"
"28879109465555478519404026306574886715058206819089020007083836762738548458177115317644757302700698555713669596228"
"42914819860834936475292719074168444365510704342711559699508093042880177904174497792",
chars_format::fixed, 309, errc::result_out_of_range, double_inf},
// (1 + 1 - 2^-53) * 2^1023 exactly, followed by a thousand 0 digits
{"17976931348623158079372897140530341507993413271003782693617377898044496829276475094664901797758720709633028641669"
"28879109465555478519404026306574886715058206819089020007083836762738548458177115317644757302700698555713669596228"
"42914819860834936475292719074168444365510704342711559699508093042880177904174497792."
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
chars_format::fixed, 1310, errc::result_out_of_range, double_inf},
// above (1 + 1 - 2^-53) * 2^1023: append a thousand 0 digits followed by a 1 digit
{"17976931348623158079372897140530341507993413271003782693617377898044496829276475094664901797758720709633028641669"
"28879109465555478519404026306574886715058206819089020007083836762738548458177115317644757302700698555713669596228"
"42914819860834936475292719074168444365510704342711559699508093042880177904174497792."
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
chars_format::fixed, 1311, errc::result_out_of_range, double_inf},
// above (1 + 1 - 2^-53) * 2^1023: appended a 1 digit
{"17976931348623158079372897140530341507993413271003782693617377898044496829276475094664901797758720709633028641669"
"28879109465555478519404026306574886715058206819089020007083836762738548458177115317644757302700698555713669596228"
"42914819860834936475292719074168444365510704342711559699508093042880177904174497792.1",
chars_format::fixed, 311, errc::result_out_of_range, double_inf},
// above (1 + 1 - 2^-53) * 2^1023: incremented last digit
{"17976931348623158079372897140530341507993413271003782693617377898044496829276475094664901797758720709633028641669"
"28879109465555478519404026306574886715058206819089020007083836762738548458177115317644757302700698555713669596228"
"42914819860834936475292719074168444365510704342711559699508093042880177904174497792",
chars_format::fixed, 309, errc::result_out_of_range, double_inf},
// below 1 * 2^1024: decremented last digit, then appended three 9 digits
{"17976931348623159077293051907890247336179769789423065727343008115773267580550096313270847732240753602112011387987"
"13933576587897688144166224928474306394741243777678934248654852763022196012460941194530829520850057688381506823424"
"62881473913110540827237163350510684586298239947245938479716304835356329624224137215.999",
chars_format::fixed, 313, errc::result_out_of_range, double_inf},
// 1 * 2^1024 exactly
{"17976931348623159077293051907890247336179769789423065727343008115773267580550096313270847732240753602112011387987"
"13933576587897688144166224928474306394741243777678934248654852763022196012460941194530829520850057688381506823424"
"62881473913110540827237163350510684586298239947245938479716304835356329624224137216",
chars_format::fixed, 309, errc::result_out_of_range, double_inf},
};

Просмотреть файл

@ -133,4 +133,125 @@ inline constexpr FloatFromCharsTestCase float_from_chars_test_cases[] = {
{"1e-9999", chars_format::scientific, 7, errc::result_out_of_range, 0.0f},
{"10e+5199", chars_format::scientific, 8, errc::result_out_of_range, float_inf},
{"0.001e-5199", chars_format::scientific, 11, errc::result_out_of_range, 0.0f},
// GH-931 "<charconv>: hex from_chars(\"0.fffffffffffff8p-1022\") is incorrect"
// Test cases for values close to std::numeric_limits<float>::min() and std::numeric_limits<float>::max()
{"7.fffffp-129", chars_format::hex, 12, errc{}, 0x0.fffffep-126f},
{"8.00000p-129", chars_format::hex, 12, errc{}, 0x1.000000p-126f},
{"0.fffffep-126", chars_format::hex, 13, errc{}, 0x0.fffffep-126f},
{"0.ffffffp-126", chars_format::hex, 13, errc{}, 0x1.000000p-126f},
{"1.000000p-126", chars_format::hex, 13, errc{}, 0x1.000000p-126f},
{"1.fffffcp-127", chars_format::hex, 13, errc{}, 0x0.fffffep-126f},
{"1.fffffdp-127", chars_format::hex, 13, errc{}, 0x0.fffffep-126f},
{"1.fffffep-127", chars_format::hex, 13, errc{}, 0x1.000000p-126f},
{"1.ffffffp-127", chars_format::hex, 13, errc{}, 0x1.000000p-126f},
{"2.000000p-127", chars_format::hex, 13, errc{}, 0x1.000000p-126f},
{"3.fffff8p-128", chars_format::hex, 13, errc{}, 0x0.fffffep-126f},
{"3.fffff9p-128", chars_format::hex, 13, errc{}, 0x0.fffffep-126f},
{"3.fffffbp-128", chars_format::hex, 13, errc{}, 0x0.fffffep-126f},
{"3.fffffcp-128", chars_format::hex, 13, errc{}, 0x1.000000p-126f},
{"3.fffffdp-128", chars_format::hex, 13, errc{}, 0x1.000000p-126f},
{"3.fffffep-128", chars_format::hex, 13, errc{}, 0x1.000000p-126f},
{"3.ffffffp-128", chars_format::hex, 13, errc{}, 0x1.000000p-126f},
{"4.000000p-128", chars_format::hex, 13, errc{}, 0x1.000000p-126f},
{"7.fffff0p-129", chars_format::hex, 13, errc{}, 0x0.fffffep-126f},
{"7.fffff1p-129", chars_format::hex, 13, errc{}, 0x0.fffffep-126f},
{"7.fffff7p-129", chars_format::hex, 13, errc{}, 0x0.fffffep-126f},
{"7.fffff8p-129", chars_format::hex, 13, errc{}, 0x1.000000p-126f},
{"7.fffff9p-129", chars_format::hex, 13, errc{}, 0x1.000000p-126f},
{"7.fffffbp-129", chars_format::hex, 13, errc{}, 0x1.000000p-126f},
{"7.fffffcp-129", chars_format::hex, 13, errc{}, 0x1.000000p-126f},
{"7.fffffdp-129", chars_format::hex, 13, errc{}, 0x1.000000p-126f},
{"7.ffffffp-129", chars_format::hex, 13, errc{}, 0x1.000000p-126f},
{"8.000000p-129", chars_format::hex, 13, errc{}, 0x1.000000p-126f},
{"0.fffffe0p-126", chars_format::hex, 14, errc{}, 0x0.fffffep-126f},
{"0.fffffe1p-126", chars_format::hex, 14, errc{}, 0x0.fffffep-126f},
{"0.fffffefp-126", chars_format::hex, 14, errc{}, 0x0.fffffep-126f},
{"0.ffffff0p-126", chars_format::hex, 14, errc{}, 0x1.000000p-126f},
{"0.ffffff1p-126", chars_format::hex, 14, errc{}, 0x1.000000p-126f},
{"0.ffffff7p-126", chars_format::hex, 14, errc{}, 0x1.000000p-126f},
{"0.ffffff8p-126", chars_format::hex, 14, errc{}, 0x1.000000p-126f},
{"0.ffffff9p-126", chars_format::hex, 14, errc{}, 0x1.000000p-126f},
{"0.fffffffp-126", chars_format::hex, 14, errc{}, 0x1.000000p-126f},
{"1.0000000p-126", chars_format::hex, 14, errc{}, 0x1.000000p-126f},
{"1.fffffc0p-127", chars_format::hex, 14, errc{}, 0x0.fffffep-126f},
{"1.fffffc1p-127", chars_format::hex, 14, errc{}, 0x0.fffffep-126f},
{"1.fffffdfp-127", chars_format::hex, 14, errc{}, 0x0.fffffep-126f},
{"1.fffffe0p-127", chars_format::hex, 14, errc{}, 0x1.000000p-126f},
{"1.fffffe1p-127", chars_format::hex, 14, errc{}, 0x1.000000p-126f},
{"1.fffffefp-127", chars_format::hex, 14, errc{}, 0x1.000000p-126f},
{"1.ffffff0p-127", chars_format::hex, 14, errc{}, 0x1.000000p-126f},
{"1.ffffff1p-127", chars_format::hex, 14, errc{}, 0x1.000000p-126f},
{"1.fffffffp-127", chars_format::hex, 14, errc{}, 0x1.000000p-126f},
{"2.0000000p-127", chars_format::hex, 14, errc{}, 0x1.000000p-126f},
{"3.fffff80p-128", chars_format::hex, 14, errc{}, 0x0.fffffep-126f},
{"3.fffff81p-128", chars_format::hex, 14, errc{}, 0x0.fffffep-126f},
{"3.fffffbfp-128", chars_format::hex, 14, errc{}, 0x0.fffffep-126f},
{"3.fffffc0p-128", chars_format::hex, 14, errc{}, 0x1.000000p-126f},
{"3.fffffc1p-128", chars_format::hex, 14, errc{}, 0x1.000000p-126f},
{"3.fffffdfp-128", chars_format::hex, 14, errc{}, 0x1.000000p-126f},
{"3.fffffe0p-128", chars_format::hex, 14, errc{}, 0x1.000000p-126f},
{"3.fffffe1p-128", chars_format::hex, 14, errc{}, 0x1.000000p-126f},
{"3.fffffffp-128", chars_format::hex, 14, errc{}, 0x1.000000p-126f},
{"4.0000000p-128", chars_format::hex, 14, errc{}, 0x1.000000p-126f},
{"0.ffffffp+128", chars_format::hex, 13, errc{}, 0x1.fffffep+127f},
{"1.000000p+128", chars_format::hex, 13, errc::result_out_of_range, float_inf},
{"1.fffffep+127", chars_format::hex, 13, errc{}, 0x1.fffffep+127f},
{"1.ffffffp+127", chars_format::hex, 13, errc::result_out_of_range, float_inf},
{"2.000000p+127", chars_format::hex, 13, errc::result_out_of_range, float_inf},
{"3.fffffcp+126", chars_format::hex, 13, errc{}, 0x1.fffffep+127f},
{"3.fffffdp+126", chars_format::hex, 13, errc{}, 0x1.fffffep+127f},
{"3.fffffep+126", chars_format::hex, 13, errc::result_out_of_range, float_inf},
{"3.ffffffp+126", chars_format::hex, 13, errc::result_out_of_range, float_inf},
{"4.000000p+126", chars_format::hex, 13, errc::result_out_of_range, float_inf},
{"7.fffff8p+125", chars_format::hex, 13, errc{}, 0x1.fffffep+127f},
{"7.fffff9p+125", chars_format::hex, 13, errc{}, 0x1.fffffep+127f},
{"7.fffffbp+125", chars_format::hex, 13, errc{}, 0x1.fffffep+127f},
{"7.fffffcp+125", chars_format::hex, 13, errc::result_out_of_range, float_inf},
{"7.fffffdp+125", chars_format::hex, 13, errc::result_out_of_range, float_inf},
{"7.ffffffp+125", chars_format::hex, 13, errc::result_out_of_range, float_inf},
{"8.000000p+125", chars_format::hex, 13, errc::result_out_of_range, float_inf},
{"0.ffffff0p+128", chars_format::hex, 14, errc{}, 0x1.fffffep+127f},
{"0.ffffff1p+128", chars_format::hex, 14, errc{}, 0x1.fffffep+127f},
{"0.ffffff7p+128", chars_format::hex, 14, errc{}, 0x1.fffffep+127f},
{"0.ffffff8p+128", chars_format::hex, 14, errc::result_out_of_range, float_inf},
{"0.ffffff9p+128", chars_format::hex, 14, errc::result_out_of_range, float_inf},
{"0.fffffffp+128", chars_format::hex, 14, errc::result_out_of_range, float_inf},
{"1.0000000p+128", chars_format::hex, 14, errc::result_out_of_range, float_inf},
{"1.fffffe0p+127", chars_format::hex, 14, errc{}, 0x1.fffffep+127f},
{"1.fffffe1p+127", chars_format::hex, 14, errc{}, 0x1.fffffep+127f},
{"1.fffffefp+127", chars_format::hex, 14, errc{}, 0x1.fffffep+127f},
{"1.ffffff0p+127", chars_format::hex, 14, errc::result_out_of_range, float_inf},
{"1.ffffff1p+127", chars_format::hex, 14, errc::result_out_of_range, float_inf},
{"1.fffffffp+127", chars_format::hex, 14, errc::result_out_of_range, float_inf},
{"2.0000000p+127", chars_format::hex, 14, errc::result_out_of_range, float_inf},
{"3.fffffc0p+126", chars_format::hex, 14, errc{}, 0x1.fffffep+127f},
{"3.fffffc1p+126", chars_format::hex, 14, errc{}, 0x1.fffffep+127f},
{"3.fffffdfp+126", chars_format::hex, 14, errc{}, 0x1.fffffep+127f},
{"3.fffffe0p+126", chars_format::hex, 14, errc::result_out_of_range, float_inf},
{"3.fffffe1p+126", chars_format::hex, 14, errc::result_out_of_range, float_inf},
{"3.fffffffp+126", chars_format::hex, 14, errc::result_out_of_range, float_inf},
{"4.0000000p+126", chars_format::hex, 14, errc::result_out_of_range, float_inf},
{"7.fffff80p+125", chars_format::hex, 14, errc{}, 0x1.fffffep+127f},
{"7.fffff81p+125", chars_format::hex, 14, errc{}, 0x1.fffffep+127f},
{"7.fffffbfp+125", chars_format::hex, 14, errc{}, 0x1.fffffep+127f},
{"7.fffffc0p+125", chars_format::hex, 14, errc::result_out_of_range, float_inf},
{"7.fffffc1p+125", chars_format::hex, 14, errc::result_out_of_range, float_inf},
{"7.fffffffp+125", chars_format::hex, 14, errc::result_out_of_range, float_inf},
{"8.0000000p+125", chars_format::hex, 14, errc::result_out_of_range, float_inf},
};