# Dimension too large for TikZ modulo arithmetic [duplicate]

 \documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}

\usepackage{tikz}

\usepackage{ifthen}
\usetikzlibrary{calc}

\begin{document}

\def\sides{50}
\pgfmathsetmacro\lmu{\sides -1}

\begin{tikzpicture}
\foreach \i in {0,...,\lmu} \draw (\i *360/\sides:3cm) node(\i){\i};
\foreach \i in {0,...,\lmu} \draw let \n1={int(mod(\i+2,\sides))} in (\i) -- (\n1);
\end{tikzpicture}

\end{document}


I try to do some modulo >40 pictures. I found particularly useful the code in this answer. But now I found a dimension too large-limitation. Does anybody know how to overcome this?