Numeral system converter
This commit is contained in:
@@ -144,12 +144,12 @@ public class JsclMathEngine implements MathEngine {
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public String format(double value) throws NumeralBaseException {
|
||||
public String format(double value) {
|
||||
return format(value, numeralBase);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public String format(double value, @Nonnull NumeralBase nb) throws NumeralBaseException {
|
||||
public String format(double value, @Nonnull NumeralBase nb) {
|
||||
if (Double.isInfinite(value)) {
|
||||
return formatInfinity(value);
|
||||
}
|
||||
@@ -189,12 +189,12 @@ public class JsclMathEngine implements MathEngine {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String format(@Nonnull BigInteger value) throws NumeralBaseException {
|
||||
public String format(@Nonnull BigInteger value) {
|
||||
return format(value, numeralBase);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public String format(@Nonnull BigInteger value, @Nonnull NumeralBase nb) throws NumeralBaseException {
|
||||
public String format(@Nonnull BigInteger value, @Nonnull NumeralBase nb) {
|
||||
if (nb == NumeralBase.dec) {
|
||||
if (BigInteger.ZERO.equals(value)) {
|
||||
return "0";
|
||||
|
@@ -45,12 +45,12 @@ public interface MathContext {
|
||||
void setGroupingSeparator(char groupingSeparator);
|
||||
|
||||
@Nonnull
|
||||
String format(double value) throws NumeralBaseException;
|
||||
String format(double value);
|
||||
|
||||
String format(@Nonnull BigInteger value) throws NumeralBaseException;
|
||||
String format(@Nonnull BigInteger value);
|
||||
|
||||
@Nonnull
|
||||
String format(double value, @Nonnull NumeralBase nb) throws NumeralBaseException;
|
||||
String format(double value, @Nonnull NumeralBase nb);
|
||||
|
||||
@Nonnull
|
||||
String addGroupingSeparators(@Nonnull NumeralBase nb, @Nonnull String ungroupedIntValue);
|
||||
|
@@ -1,12 +0,0 @@
|
||||
package jscl;
|
||||
|
||||
import jscl.text.msg.Messages;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class NumeralBaseException extends JsclArithmeticException {
|
||||
|
||||
public NumeralBaseException(@Nonnull Double value) {
|
||||
super(Messages.msg_17, value);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user