MCPcopy Create free account
hub / github.com/davisking/dlib / operator%

Function operator%

dlib/bigint/bigint_kernel_1.cpp:747–768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

745// ----------------------------------------------------------------------------------------
746
747 const bigint_kernel_1 operator% (
748 uint16 lhs,
749 const bigint_kernel_1& rhs
750 )
751 {
752 typedef bigint_kernel_1 bigint;
753 // temp is zero by default
754 bigint::data_record* temp = new bigint::data_record(rhs.slack);
755
756 if (rhs.data->digits_used == 1)
757 {
758 // if rhs is just an uint16 inside then perform the modulus
759 *(temp->number) = lhs % *(rhs.data->number);
760 }
761 else
762 {
763 // if rhs is bigger than lhs then the answer is lhs
764 *(temp->number) = lhs;
765 }
766
767 return bigint_kernel_1(temp,0);
768 }
769
770// ----------------------------------------------------------------------------------------
771

Callers

nothing calls this directly

Calls 1

bigint_kernel_1Class · 0.85

Tested by

no test coverage detected