mirror of
https://github.com/DanilaFe/abacus
synced 2024-12-22 07:20:09 -08:00
Merge pull request #27 from DanilaFe/fixes
Fix a number of small issues not worthy of their own branches.
This commit is contained in:
commit
07581557c7
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -24,7 +24,9 @@ hs_err_pid*
|
|||
# Custom Stuff
|
||||
# Gradle
|
||||
.gradle/*
|
||||
build/*
|
||||
**/build/*
|
||||
**/out/**
|
||||
**/.DS_Store
|
||||
|
||||
# IntelliJ
|
||||
.idea/*
|
||||
|
|
|
@ -5,7 +5,7 @@ import org.nwapw.abacus.exception.ComputationInterruptedException;
|
|||
/**
|
||||
* An interface used to represent a number.
|
||||
*/
|
||||
public abstract class NumberInterface {
|
||||
public abstract class NumberInterface implements Comparable<NumberInterface> {
|
||||
|
||||
/**
|
||||
* Check if the thread was interrupted and
|
||||
|
@ -158,14 +158,6 @@ public abstract class NumberInterface {
|
|||
return intPowInternal(exponent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares this number to another.
|
||||
*
|
||||
* @param number the number to compare to.
|
||||
* @return same as Integer.compare();
|
||||
*/
|
||||
public abstract int compareTo(NumberInterface number);
|
||||
|
||||
/**
|
||||
* Same as Math.signum().
|
||||
*
|
||||
|
|
|
@ -68,6 +68,7 @@ class Abacus(val configuration: Configuration) {
|
|||
pluginManager.reload()
|
||||
with(mutableContext) {
|
||||
numberImplementation = pluginManager.numberImplementationFor(configuration.numberImplementation)
|
||||
?: StandardPlugin.IMPLEMENTATION_NAIVE
|
||||
clearVariables()
|
||||
clearDefinitions()
|
||||
}
|
||||
|
@ -87,7 +88,7 @@ class Abacus(val configuration: Configuration) {
|
|||
* @param input the input string to parse
|
||||
* @return the resulting tree, null if the tree builder or the produced tree are null.
|
||||
*/
|
||||
fun parseString(input: String): TreeNode? = treeBuilder.fromString(input)
|
||||
fun parseString(input: String): TreeNode = treeBuilder.fromString(input)
|
||||
/**
|
||||
* Evaluates the given tree.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue
Block a user