add checks for rem and mod. fixes #5382
Merge branch 'master' of github.com:JuliaLang/julia