tico 0.1
Mechanical Watch Terminal Timegrapher
Functions
modsigned.c File Reference
#include "modsigned.h"
#include <stddef.h>
Include dependency graph for modsigned.c:

Functions

size_t modSigned (int value, size_t ArrayLength)
 Computes the modulus of a signed integer with respect to an array length. More...
 

Function Documentation

◆ modSigned()

size_t modSigned ( int  value,
size_t  ArrayLength 
)

Computes the modulus of a signed integer with respect to an array length.

  • This function takes a signed integer value and an array length, and returns the modulus of the value with respect to the array length. The result is always a non-negative integer that falls within the range of valid indices for the array.
Parameters
valueThe signed integer value to be modded.
ArrayLengthThe length of the array, which must be greater than 0.
Returns
The modulus of the value with respect to the array length, as a size_t.