Files
x86_microcode/80386/disassembler/include/alfe/wrap.h
T
2026-05-23 11:01:52 +01:00

13 lines
248 B
C++

#include "alfe/main.h"
#ifndef INCLUDED_WRAP_H
#define INCLUDED_WRAP_H
// Works like the % operator but doesn't reflect around 0
template<class T> T wrap(const T& a, const T& b)
{
return a < 0 ? b - (-a)%b : a%b;
}
#endif // INCLUDED_WRAP_H