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

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

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

import java.util.Stack;

final class Div implements PostScriptOperation {
	@Override
	/**
	 * num1 num2 div quotient 

* * divides num1 by num2, producing a result that is * always a real number even if both operands are integers. * Use idiv instead if the operands are integers and an * integer result is desired.

* * errors: stackunderflow, typecheck, undefinedresult */ public void eval(Stack environment) { double num2 = (Double)environment.pop(); double num1 = (Double)environment.pop(); environment.push(num1 / num2); } }