private static function _intStrModulus($intStr, $divisor) {
        // If possible, use integer type for calculation.
        $int = (int) $intStr;
        if ((string) $int == (string) $intStr) {
            // Use of integer type is possible.
            return $int % $divisor;
        } else {
            // Cannot use integer type, use BC Math library.
            if (extension_loaded('bcmath')) {
                return bcmod($intStr, (string) $divisor);
            } else {
                throw new RuntimeException('BC Math functions are not available.', self::E_NO_BCMATH);
            }
        }
    }