if (value.length() != 1 || value.getCarType() != ConsType.NUMBER)
throw new UndefinedResultException("The " + operation + " operation takes one decimal number for its arguments.", this);
BigDec inp = (BigDec) value.getCar();
//Special points (e.g. angles at which sin, cos, etc. have exact answers
if (operation.equals("cos") && ((parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(180.0)).eq(new BigDec(90.0)))
|| (parser.getAngleType().equals("Radians") && inp.mod(new BigDec(Math.PI)).eq(new BigDec(Math.PI / 2))) || (parser.getAngleType().equals("Grads") && inp.mod(new BigDec(200.0)).eq(new BigDec(100.0))))) {
return new ConsCell(BigDec.ZERO, ConsType.NUMBER);
}
if ((operation.equals("sin") || operation.equals("tan")) && ((parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(180.0)).eq(new BigDec(0.0)))
|| (parser.getAngleType().equals("Radians") && inp.mod(new BigDec(Math.PI)).eq(BigDec.ZERO)) || (parser.getAngleType().equals("Grads") && inp.mod(new BigDec(200.0)).eq(BigDec.ZERO)))) {