diff --git a/Internals.md b/Internals.md index 47b60cc..0cac377 100644 --- a/Internals.md +++ b/Internals.md @@ -1,5 +1,5 @@ # Number Implementation -Abacus, being design with future extensions in mind, does not simply operate on doubles. As other approaches to storing numbers are possible, and it is also possible for the "number" to carry more or less information depending on context, abacus attempts to stay away from a hard-coded implementation. As such, it provides an interface, `NumberInterface`, which is then implemented by an implementation of a number. This interface provides several primitive methods, such as add, subtract, multiply, divide, take to an integer power, etc. The rest of the functions are built on top of these methods, thus being completely implementation-agnostic. This sacrifices speed and prevents abacus from using standard Java library functions like Math.sin, but in exchange allows for the ability to implement the number in many different ways. +Abacus, being designed with future extensions in mind, does not simply operate on doubles. As other approaches to storing numbers are possible, and it is also possible for the "number" to carry more or less information depending on context, abacus attempts to stay away from a hard-coded implementation. As such, it provides an interface, `NumberInterface`, which is then implemented by an implementation of a number. This interface provides several primitive methods, such as add, subtract, multiply, divide, take to an integer power, etc. The rest of the functions are built on top of these methods, thus being completely implementation-agnostic. This sacrifices speed and prevents abacus from using standard Java library functions like Math.sin, but in exchange allows for the ability to implement the number in many different ways. ## Immutability All the `NumberInterface` implementations are immutable - any operation, such as addition, creates a new copy of the output. This prevents accidental side effects in functions, and removes the need for duplication when returning instances of `NumberInterface` from functions, or storing them as variables.