orient.comp: fix modulo arithmetic

thanks to Martin Kaplan.