Skip to content

Commit 0673712

Browse files
committed
refactor(library/math): extracts numberTaxonomy into dedicated file
1 parent 27e2fc3 commit 0673712

File tree

2 files changed

+30
-22
lines changed

2 files changed

+30
-22
lines changed

src/library/math/numberTaxonomy.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/** Examples from each classification of number */
2+
const numberTaxonomy = {
3+
signed: {
4+
negative: /**/-1,
5+
positive: /**/+1,
6+
},
7+
fractional: {
8+
rational : 1 / 2,
9+
irrational : Math.PI,
10+
transcendental: Math.E,
11+
},
12+
infinite: {
13+
positive: Infinity,
14+
negative: -Infinity,
15+
},
16+
runtime: {
17+
min: Number.MIN_VALUE,
18+
max: Number.MAX_VALUE,
19+
},
20+
origin : 0,
21+
undefined: NaN,
22+
} as const;
23+
24+
export {
25+
numberTaxonomy,
26+
};

src/library/math/operator/predicate/isOperable.test.ts

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,14 @@ import {
44
expect,
55
} from 'vitest';
66

7+
import {
8+
numberTaxonomy,
9+
} from '../../numberTaxonomy';
10+
711
import {
812
isOperable,
913
} from './isOperable';
1014

11-
const numberTaxonomy = {
12-
signed: {
13-
negative: /**/-1,
14-
positive: /**/+1,
15-
},
16-
fractional: {
17-
rational : 1 / 2,
18-
irrational : Math.PI,
19-
transcendental: Math.E,
20-
},
21-
infinite: {
22-
positive: Infinity,
23-
negative: -Infinity,
24-
},
25-
runtime: {
26-
min: Number.MIN_VALUE,
27-
max: Number.MAX_VALUE,
28-
},
29-
origin : 0,
30-
undefined: NaN,
31-
} as const;
32-
3315
describe(isOperable, () => {
3416
const theSoleInoperableNumber = numberTaxonomy.undefined;
3517

0 commit comments

Comments
 (0)