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

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

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

import java.util.Stack;

final class Round implements PostScriptOperation {
	@Override
	/**
	 * num1 round num2 

* * returns the integer value nearest to num1. * If num1 is equally close to its two nearest * integers, round returns the greater of the two. * The type of the result is the same as * the type of the operand.

* * errors: stackunderflow, typecheck */ public void eval(Stack environment) { environment.push(Math.round((Double)environment.pop())); } }