Skip to content

Commit

Permalink
Remove dead code (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessealama authored Nov 15, 2024
1 parent 31cd221 commit 1565bb8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [21.1.0]

### Removed

- Some dead code has been deleted.

## [20.0.0]

### Changed
Expand Down
5 changes: 1 addition & 4 deletions src/Decimal.mts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { Rational } from "./Rational.mjs";

const ratOne = new Rational(1n, 1n);
const ratTen = new Rational(10n, 1n);

function _cohort(s: string): "0" | "-0" | Rational {
if (s.match(/^-/)) {
let c = _cohort(s.substring(1));
Expand Down Expand Up @@ -46,7 +43,7 @@ function _quantum(s: string): number {
}

if (s.match(/[eE]/)) {
let [dec, exp] = s.split(/[eE]/);
let [_, exp] = s.split(/[eE]/);
return parseInt(exp);
}

Expand Down
4 changes: 4 additions & 0 deletions src/Decimal128.mts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ function pickQuantum(
return EXPONENT_MAX;
}

if (d === "0" || d === "-0") {
return preferredQuantum;
}

return preferredQuantum;
}

Expand Down

0 comments on commit 1565bb8

Please sign in to comment.