Skip to content

Commit a2774ae

Browse files
authored
Merge branch 'fastfloat:main' into main
2 parents 6bc8902 + 9f30728 commit a2774ae

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
---
8+
9+
**Describe the bug**
10+
A clear and concise description of what the bug is.
11+
12+
**To Reproduce**
13+
Ideally, you should provide a reproducible test case.
14+
15+
**Expected behavior**
16+
A clear and concise description of what you expected to happen.
17+
18+
**Additional context**
19+
Add any other context about the problem here.
20+
21+
**Note:** Bug reports should come with a test case or, at least, an analysis.
22+
23+
**Automated tool policy**: If you use an automated tool (e.g., static analysis,
24+
LLM, etc.), you need to demonstrate an understanding of the issue you are raising. Usually, a bug is demonstrated by a test case. Do not copy-paste what a tool is telling you.

include/fast_float/float_common.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,6 @@ fastfloat_strncasecmp3(UC const *actual_mixedcase,
364364
return false;
365365
}
366366
}
367-
368-
return true;
369367
}
370368

371369
template <typename UC>
@@ -416,8 +414,6 @@ fastfloat_strncasecmp5(UC const *actual_mixedcase,
416414
return (actual_mixedcase[4] | 32) == (expected_lowercase[4]);
417415
}
418416
}
419-
420-
return true;
421417
}
422418

423419
// Compares two ASCII strings in a case insensitive manner.

tests/basictest.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,9 @@ TEST_CASE("double.general") {
11671167
// DBL_TRUE_MIN / 2 + 0.0000000000000001e-324
11681168
verify("2.4703282292062328e-324", 0x0.0000000000001p-1022);
11691169

1170+
verify("0.2470328229206232720e-323", 0.0, std::errc::result_out_of_range);
1171+
verify("0.2470328229206232721e-323", 0x0.0000000000001p-1022);
1172+
11701173
verify("-2.2222222222223e-322", -0x1.68p-1069);
11711174
verify("9007199254740993.0", 0x1p+53);
11721175
verify("860228122.6654514319E+90", 0x1.92bb20990715fp+328);
@@ -1262,8 +1265,13 @@ TEST_CASE("double.general") {
12621265
verify("4.9406564584124654e-324", 0x0.0000000000001p-1022);
12631266
verify("2.2250738585072009e-308", 0x0.fffffffffffffp-1022);
12641267
verify("2.2250738585072014e-308", 0x1p-1022);
1268+
verify("0.2225073858507201136e-307", 0x0.fffffffffffffp-1022);
1269+
verify("0.2225073858507201137e-307", 0x1p-1022);
12651270
verify("1.7976931348623157e308", 0x1.fffffffffffffp+1023);
12661271
verify("1.7976931348623158e308", 0x1.fffffffffffffp+1023);
1272+
verify("1.7976931348623158079e308", std::numeric_limits<double>::max());
1273+
verify("1.7976931348623158080e308", std::numeric_limits<double>::infinity(),
1274+
std::errc::result_out_of_range);
12671275
verify("4503599627370496.5", 4503599627370496.5);
12681276
verify("4503599627475352.5", 4503599627475352.5);
12691277
verify("4503599627475353.5", 4503599627475353.5);
@@ -1543,6 +1551,8 @@ TEST_CASE("float.general") {
15431551
verify("0.7006492e-45", 0.f, std::errc::result_out_of_range);
15441552
// FLT_TRUE_MIN / 2 + 0.0000001e-45
15451553
verify("0.7006493e-45", 0x1p-149f);
1554+
verify("0.7006492321624085354e-45", 0.f, std::errc::result_out_of_range);
1555+
verify("0.7006492321624085355e-45", 0x1p-149f);
15461556

15471557
// max
15481558
verify("340282346638528859811704183484516925440", 0x1.fffffep+127f);
@@ -1553,6 +1563,9 @@ TEST_CASE("float.general") {
15531563
// that rounds to FLT_MAX
15541564
verify("340282356779733661637539395458142568447",
15551565
std::numeric_limits<float>::max());
1566+
verify("0.3402823567797336616e39", std::numeric_limits<float>::max());
1567+
verify("0.3402823567797336617e39", std::numeric_limits<float>::infinity(),
1568+
std::errc::result_out_of_range);
15561569

15571570
verify("-1e-999", -0.0f, std::errc::result_out_of_range);
15581571
verify("1."
@@ -1563,6 +1576,8 @@ TEST_CASE("float.general") {
15631576
"175494140627517859246175898662808184331245864732796240031385942718174"
15641577
"6759860647699724722770042717456817626953125e-38",
15651578
0x1.fffff8p-127f);
1579+
verify("1.1754942807573642917e-38", 0x1.fffffcp-127f);
1580+
verify("1.1754942807573642918e-38", std::numeric_limits<float>::min());
15661581
verify_runtime(
15671582
append_zeros("1."
15681583
"17549414062751785924617589866280818433124586473279624003138"

0 commit comments

Comments
 (0)