Skip to content

Commit c736b0d

Browse files
committed
Fix range check and message
1 parent 9d43c7d commit c736b0d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎pages/Modules.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,8 +696,8 @@ class ProgrammerCalculator extends Calculator {
696696

697697
constructor(public base: number) {
698698
super();
699-
if (base > ProgrammerCalculator.digits.length) {
700-
throw new Error("base has to be at most 16");
699+
if (base <= 0 || base > ProgrammerCalculator.digits.length) {
700+
throw new Error("base has to be within 0 to 16 inclusive.");
701701
}
702702
}
703703

0 commit comments

Comments
 (0)