The polynom package for the long division of polynomials does not always get the remainder right.
\documentclass{minimal}
\usepackage{polynom}
\begin{document}
$$\polylongdiv{x^3+1}{x^2+1}$$
$$\polylongdiv{x^3+x^0}{x^2+1}$$
\end{document}
The remainder ought to be $-x+1$, not $-x$. How can I go about correcting this example?