Implemented fast modulo from tuple.