All pastes #47060 Raw Edit

Unnamed

public java v1 · immutable
#47060 ·published 2006-03-26 19:29 UTC
rendered paste body
public class Sine implements IFunction {	public IValue execute(IValue[] params, ExpressionContext context) throws ExpressionException {		if (params == null || params.length != 1)			throw new ExpressionException("%se.fnord.ecalc.exceptions.expressionexception.arity");				double param = params[0].toDouble();				if (context.angleType == IOperators.ANGLE_DEG)			param = param * Math.PI / 180;		return new Literal(Math.sin(param)); 	}	}