\documentclass{article}
\usepackage{expl3}
\begin{document}
expl3 mod
\ExplSyntaxOn
$\int_mod:nn {11} {3}$ ~
$\int_mod:nn {-11} {3}$ ~
$\int_mod:nn {11} {-3}$ ~
$\int_mod:nn {-11} {-3}$
\ExplSyntaxOff
lua fmod
$\directlua{tex.sprint(math.fmod(11,3))}$
$\directlua{tex.sprint(math.fmod(-11,3))}$
$\directlua{tex.sprint(math.fmod(11,-3))}$
$\directlua{tex.sprint(math.fmod(-11,-3))}$
lua mod
$\directlua{tex.sprint(math.mod(11,3))}$
$\directlua{tex.sprint(math.mod(-11,3))}$
$\directlua{tex.sprint(math.mod(11,-3))}$