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

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

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

import java.util.Stack;
final class Cvi implements PostScriptOperation {
	@Override
	/**
	 * num cvi int or string cvi int 

* * takes an integer, real, or string and produces an * integer result. If the operand is an integer, cvi * simply returns it. If the operand is a real number, * it truncates any fractional part (that is, rounds * it toward 0) and converts it to an integer. * If the operand is a string, cvi invokes the equivalent * of the token operator to interpret the characters * of the string as a number according to the PostScript * syntax rules. If that number is a real number, cvi converts * it to an integer. * A rangecheck error occurs if a real number is too * large to convert to an integer.

* * errors: invalidaccess, rangecheck, stackunderflow, * syntaxError, typecheck, */ public void eval(Stack environment) { environment.push(environment.pop()); } }