mod: Vector modulus.

modR Documentation

Vector modulus.

Description

Computes the remainder of dividing a by n using the modulo operator. This function uses a trick to avoid using the modulo operator directly, which can be slow for large values of a and n.

Arguments

a

The input value of type T. This is a NumericVector.

n

The divisor of type int.

Value

The remainder of dividing a by n, of type T in the form of a NumericVector.

Author(s)

Phil Davies.


spbal documentation built on April 4, 2025, 2:05 a.m.