Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jessealama committed Dec 4, 2023
1 parent cfc7b71 commit 3d89efc
Show file tree
Hide file tree
Showing 4 changed files with 357 additions and 389 deletions.
32 changes: 32 additions & 0 deletions src/common.mts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,36 @@ export function countSignificantDigits(s: string): number {
}

export type Digit = -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; // -1 signals that we're moving from the integer part to the decimal part of a decimal number
export type DigitAsString =
| "0"
| "1"
| "2"
| "3"
| "4"
| "5"
| "6"
| "7"
| "8"
| "9";
export type DigitOrTen = Digit | 10;

export type RoundingMode =
| "ceil"
| "floor"
| "expand"
| "trunc"
| "halfEven"
| "halfExpand"
| "halfCeil"
| "halfFloor"
| "halfTrunc";

export const ROUNDING_MODE_CEILING: RoundingMode = "ceil";
export const ROUNDING_MODE_FLOOR: RoundingMode = "floor";
export const ROUNDING_MODE_EXPAND: RoundingMode = "expand";
export const ROUNDING_MODE_TRUNCATE: RoundingMode = "trunc";
export const ROUNDING_MODE_HALF_EVEN: RoundingMode = "halfEven";
export const ROUNDING_MODE_HALF_EXPAND: RoundingMode = "halfExpand";
export const ROUNDING_MODE_HALF_CEILING: RoundingMode = "halfCeil";
export const ROUNDING_MODE_HALF_FLOOR: RoundingMode = "halfFloor";
export const ROUNDING_MODE_HALF_TRUNCATE: RoundingMode = "halfTrunc";
Loading

0 comments on commit 3d89efc

Please sign in to comment.