All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openpdf.renderer.function.postscript.operation.Mod Maven / Gradle / Ivy

The newest version!
package org.openpdf.renderer.function.postscript.operation;

import java.util.Stack;


final class Mod implements PostScriptOperation {
	@Override
	/**
	 * int1 int2 mod remainder 

* * returns the remainder that results from * dividing int1 by int2. The sign of the result * is the same as the sign of the dividend int1. * Both operands must be integers and the result * is an integer.

* * errors: stackunderflow, typecheck, undefinedresult */ public void eval(Stack environment) { long int2 = (Long)environment.pop(); long int1 = (Long)environment.pop(); environment.push(int1 % int2); } }