Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/java/math/Maths.java
Original file line number Diff line number Diff line change
Expand Up @@ -1575,6 +1575,7 @@ public static void main(String args[]) {
System.out.println(" RUNTIME = " + ((t4 - t3) / 1.0E6) + " ms");


System.out.println(" fact = " + fact("0.01"));
}
/*We use the principle:
* pi=(magic_whole_no)*(SUM(i^-n))^(1/n) < where i goes from 1 to infinity during summation >
Expand Down
353 changes: 353 additions & 0 deletions src/main/java/parser/BigMathExpression.java

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/main/java/parser/Function.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public double calc(double... x) {
return Double.NaN;
}

public static boolean assignObject(String input) {
public static boolean assignObject(String input, Class mathExpClass) {

/**
* Check if it is a function assignment operation...e.g:
Expand Down Expand Up @@ -273,9 +273,10 @@ public static boolean assignObject(String input) {

success = true;
} else {
MathExpression expr = new MathExpression(rhs);
MathExpression expr = mathExpClass == BigMathExpression.class ? new BigMathExpression(rhs) : new MathExpression(rhs);
String val = expr.solve();
String referenceName = expr.getReturnObjectName();
//System.out.println("rhs: "+rhs+", mathExpClass: "+mathExpClass+", expr.class: "+expr.getClass()+", val: "+val+", type: "+expr.getReturnType());

if (Variable.isVariableString(newFuncName) || isVarNamesList) {
Function f;
Expand Down
Loading