mirror of
https://github.com/DanilaFe/abacus
synced 2026-01-27 09:05:19 +00:00
Implement preciseNumber for arbitrary precision.
This commit is contained in:
@@ -88,6 +88,9 @@ public class NaiveNumber implements NumberInterface {
|
||||
@Override
|
||||
public NumberInterface promoteTo(Class<? extends NumberInterface> toClass) {
|
||||
if(toClass == this.getClass()) return this;
|
||||
else if(toClass == PreciseNumber.class){
|
||||
return new PreciseNumber(Double.toString(value));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user