Skip to content

Commit 6559dc1

Browse files
committed
Hmm, the issue only occurs with float. Cast it back up to long double
1 parent 70bdbbe commit 6559dc1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/Nat/casting.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ TEST_CASE("Casting arby::Nat to float", "[casting]") {
2525
auto value = GENERATE(take(1000, random((uintmax_t)0, std::numeric_limits<uintmax_t>::max())));
2626

2727
// float is so imprecise for large values that we need to cast the input too
28-
CHECK((float)arby::Nat((float)value) == (float)value);
28+
CHECK((float)arby::Nat((long double)(float)value) == (float)value);
2929
}
3030

3131
TEST_CASE("Casting arby::Nat to double", "[casting]") {

0 commit comments

Comments
 (0)