Skip to content

Commit 8465fb7

Browse files
committed
Get ready for publishing
1 parent 3d49cba commit 8465fb7

33 files changed

+661
-99
lines changed

.classpath

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
4+
<classpathentry kind="src" path="src"/>
5+
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
6+
<classpathentry kind="src" path="img"/>
7+
<classpathentry kind="output" path="bin"/>
8+
</classpath>

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.iml
22
build/
3+
bin/

.project

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>InfixParser</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8

.settings/org.eclipse.jdt.core.prefs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
4+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
5+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6+
org.eclipse.jdt.core.compiler.compliance=1.8
7+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
9+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12+
org.eclipse.jdt.core.compiler.source=1.8

README.md

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Solarys Calc
2+
3+
**Solarys Calc** is a GPL3 command line & graphical calculator. It accepts any mathematical expression includding common operators (+ - * / % ^) and some functions like:
4+
5+
* ADD (2), a+b
6+
* SUBTRACT (2), a-b
7+
* MULTIPLY (2), a*b
8+
* DIVIDE (2), a/b
9+
* MOD (2), a%b
10+
* POW (2), a^b
11+
12+
* SQUARE (1), a^2
13+
* SQRT (1), a^(1/2)
14+
* ROOT (2), a^(1/b)
15+
* NEG (1), -a
16+
* INVERSION (1), 1/a
17+
18+
* LOG10 (1), log(a) base 10
19+
* LOG (2), log(b) base a
20+
* LOGN (1), log(a) base natural
21+
* EXP (1), e^a
22+
* FACT (1), a!
23+
24+
* SIN (1)
25+
* COS (1)
26+
* TAN (1)
27+
* ASIN (1)
28+
* ACOS (1)
29+
* ATAN (1)
30+
* SINH (1)
31+
* COSH (1)
32+
* TANH (1)
33+
* RAD (1), convert a degrees to radians
34+
* DEG (1), convert a radians to degrees
35+
36+
* FLOOR (1)
37+
* ROUND (1)
38+
* CEIL (1)
39+
40+
* RAND (0), random number in [0, 1)
41+
42+
* SUM (ARITY_ALL), summatory of some numbers
43+
* AVG (ARITY_ALL), average of some numbers
44+
45+
* PI (ARITY_ZERO_ONE), 3.14
46+
* E (ARITY_ZERO_ONE), 2.72
47+
* PHI (ARITY_ZERO_ONE), 1.62
48+
49+
* SURCIRCLE (1), surface of circle with radius a
50+
* SURTRIANGLE (3), surface of triangle with sides a, b, c
51+
* PYTHHYPO (2), hypotenuse of right triangle of legs a, b
52+
* PYTHLEG (2), leg of right triangle with other sides a, b
53+
54+
# Use
55+
56+
Run `java -jar solariscalc.jar` or `java -jar solariscalc-gui.jar`

img/icon_false.png

2.15 KB
Loading

img/icon_true.png

2.65 KB
Loading

solariscalc-gui.jar

403 KB
Binary file not shown.

solariscalc.jar

403 KB
Binary file not shown.

src/net/project104/infixparser/AngleMode.java

-5
This file was deleted.

src/net/project104/infixparser/CalcException.java

-15
This file was deleted.

src/net/project104/infixparser/Constants.java

-7
This file was deleted.

src/net/project104/infixparser/Number.java

-31
This file was deleted.

src/net/project104/infixparser/Operand.java

-14
This file was deleted.

src/net/project104/infixparser/OperandStack.java

-8
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* Solarys Calc - Console & graphical calculator written in Java
2+
* Copyright 2018 Yeshe Santos García <[email protected]>
3+
*
4+
* This file is part of Solarys Calc
5+
*
6+
* Solarys Calc is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
20+
package net.project104.solaryscalc;
21+
22+
public enum AngleMode {
23+
DEGREE, RADIAN
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* Solarys Calc - Console & graphical calculator written in Java
2+
* Copyright 2018 Yeshe Santos García <[email protected]>
3+
*
4+
* This file is part of Solarys Calc
5+
*
6+
* Solarys Calc is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
20+
package net.project104.solaryscalc;
21+
22+
public class CalcException extends ArithmeticException {
23+
private CalculatorError error;
24+
25+
public CalcException(CalculatorError error){
26+
super(CalculatorError.getErrorString(error));
27+
this.error = error;
28+
}
29+
30+
public CalculatorError getError() {
31+
return error;
32+
}
33+
34+
}

src/net/project104/infixparser/Calculator.java renamed to src/net/project104/solaryscalc/Calculator.java

+22-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,31 @@
1-
package net.project104.infixparser;
1+
/* Solarys Calc - Console & graphical calculator written in Java
2+
* Copyright 2018 Yeshe Santos García <[email protected]>
3+
*
4+
* This file is part of Solarys Calc
5+
*
6+
* Solarys Calc is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
20+
package net.project104.solaryscalc;
21+
22+
import static net.project104.solaryscalc.CalculatorError.*;
223

324
import java.math.BigDecimal;
425
import java.math.BigInteger;
526
import java.math.MathContext;
627
import java.math.RoundingMode;
728

8-
import static net.project104.infixparser.CalculatorError.*;
9-
1029
public class Calculator {
1130

1231
public final static BigDecimal BIG_PI = new BigDecimal(Math.PI);

src/net/project104/infixparser/CalculatorError.java renamed to src/net/project104/solaryscalc/CalculatorError.java

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
package net.project104.infixparser;
1+
/* Solarys Calc - Console & graphical calculator written in Java
2+
* Copyright 2018 Yeshe Santos García <[email protected]>
3+
*
4+
* This file is part of Solarys Calc
5+
*
6+
* Solarys Calc is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
20+
package net.project104.solaryscalc;
221

322
public enum CalculatorError {
423
NOT_IMPLEMENTED,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/* Solarys Calc - Console & graphical calculator written in Java
2+
* Copyright 2018 Yeshe Santos García <[email protected]>
3+
*
4+
* This file is part of Solarys Calc
5+
*
6+
* Solarys Calc is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
20+
package net.project104.solaryscalc;
21+
22+
public abstract class Constants {
23+
public final static int ARITY_ZERO_ONE = -1;// takes one number if it's being written by user
24+
public final static int ARITY_ALL = -2;// takes all numbers in stack
25+
public final static int ARITY_N = -3;// takes N+1 numbers, let N be the first number in the stack
26+
}

src/net/project104/infixparser/Expression.java renamed to src/net/project104/solaryscalc/Expression.java

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
package net.project104.infixparser;
1+
/* Solarys Calc - Console & graphical calculator written in Java
2+
* Copyright 2018 Yeshe Santos García <[email protected]>
3+
*
4+
* This file is part of Solarys Calc
5+
*
6+
* Solarys Calc is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
20+
package net.project104.solaryscalc;
221

322
import java.math.BigDecimal;
423
import java.util.List;

0 commit comments

Comments
 (0)