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

Function operator%

dlib/bigint/bigint_kernel_2.cpp:748–769  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

bigint_kernel_2Class · 0.85

Tested by

no test coverage detected