Envpackage, you need to import it:
Safemathpackage, you need to import it:
x. The result is validated, so if it becomes negative, an error is returned.
y. The remainder is discarded as it should in integer arithmetic, and the input (
y) is validated not to be zero.
y. The input is validated to be valid (meaning
yis not zero). The resulting number is the reminder.
validateis called automatically on each operation, meaning after using
Subor any operation of the safemath library, so there is no need to call it manually.