Skip to content

Commit

Permalink
bigint test
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Dec 18, 2023
1 parent 0641a0d commit 27366ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/jsoncons/bigint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ class basic_bigint : protected detail::basic_bigint_base<Allocator>

if ( old_length > length() )
{
memset( data() + length(), 0, old_length - length() );
memset( data() + length(), 0, size_type(old_length - length())*sizeof(uint64_t) );
}

reduce();
Expand Down
3 changes: 1 addition & 2 deletions test/corelib/src/bigint_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,9 @@ TEST_CASE("bigint operations")
{
bigint a{0};
bigint b = bigint::from_string("1277902648419017187919156692641295109476255233737630537760832794503886212911067061184379695097643279217271150419129022856601771338794256383410400076210073482253089544155377");
bigint expected = b;
b &= a;

CHECK((expected == b));
CHECK(a == b);
}
}

0 comments on commit 27366ba

Please sign in to comment.