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

org.unlaxer.sample.calc.parser.operator.function.TanOperator Maven / Gradle / Ivy

There is a newer version: 1.1.26
Show newest version
package org.unlaxer.sample.calc.parser.operator.function;

import java.math.BigDecimal;

import org.unlaxer.sample.calc.CalculationContext;

public class TanOperator extends AbstractFunctionOperator{
	
	public static final TanOperator SINGLETON = new TanOperator();

	@Override
	public BigDecimal apply(CalculationContext calculationContext , BigDecimal operand) {
		double value = operand.doubleValue();
		return new BigDecimal(Math.tan(angle(calculationContext, value)))
			.setScale(calculationContext.scale, calculationContext.roundingMode);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy