tgrekov-philosophers
HIVE philosophers July 2024
Loading...
Searching...
No Matches
wrap_ix.c File Reference

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* wrap_ix.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/15 08:04:15 by tgrekov #+# #+# */
/* Updated: 2024/07/25 07:36:17 by tgrekov ### ########.fr */
/* */
/* ************************************************************************** */

Definition in file wrap_ix.c.

Go to the source code of this file.

Functions

int wrap_ix (int i, int max)
 Wrap a circular index, such that indices below zero are equal to max - i and indices above max continue from zero.
 

Function Documentation

◆ wrap_ix()

int wrap_ix ( int  i,
int  max 
)

Wrap a circular index, such that indices below zero are equal to max - i and indices above max continue from zero.

Parameters
[in]i
[in]max
Return values
int

Definition at line 28 of file wrap_ix.c.