first commit

This commit is contained in:
2025-07-28 13:56:49 +05:30
commit e9eb805edb
3438 changed files with 520990 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
package org.nfunk.jep.function;
import java.util.Stack;
import org.nfunk.jep.ParseException;
public class Modulus extends PostfixMathCommand {
public void run(Stack paramStack) throws ParseException {
checkStack(paramStack);
Number number1 = (Number)paramStack.pop();
Number number2 = (Number)paramStack.pop();
if (number2 instanceof Number && number1 instanceof Number) {
double d1 = ((Number)number1).doubleValue();
double d2 = ((Number)number2).doubleValue();
double d3 = d2 % d1;
paramStack.push(new Double(d3));
} else {
throw new ParseException("Invalid parameter type");
}
}
}