@obinexusmk2/hypernum 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +355 -256
- package/dist/index.cjs +4 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -7
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/types/{config → src/config}/config-loader.d.ts +0 -0
- package/dist/types/src/config/config-loader.d.ts.map +1 -0
- package/dist/types/{config → src/config}/config-parser.d.ts +0 -0
- package/dist/types/src/config/config-parser.d.ts.map +1 -0
- package/dist/types/{config → src/config}/config-resolver.d.ts +0 -0
- package/dist/types/src/config/config-resolver.d.ts.map +1 -0
- package/dist/types/{config → src/config}/config-source.d.ts +0 -0
- package/dist/types/src/config/config-source.d.ts.map +1 -0
- package/dist/types/{config → src/config}/index.d.ts +0 -0
- package/dist/types/src/config/index.d.ts.map +1 -0
- package/dist/types/{core → src/core}/common.d.ts +0 -0
- package/dist/types/src/core/common.d.ts.map +1 -0
- package/dist/types/{core → src/core}/config.d.ts +0 -0
- package/dist/types/src/core/config.d.ts.map +1 -0
- package/dist/types/{core → src/core}/constants.d.ts +0 -0
- package/dist/types/src/core/constants.d.ts.map +1 -0
- package/dist/types/{core → src/core}/errors.d.ts +0 -0
- package/dist/types/src/core/errors.d.ts.map +1 -0
- package/dist/types/{core → src/core}/hypernum.d.ts +0 -0
- package/dist/types/src/core/hypernum.d.ts.map +1 -0
- package/dist/types/{core → src/core}/index.d.ts +0 -0
- package/dist/types/src/core/index.d.ts.map +1 -0
- package/dist/types/{index.d.ts → src/index.d.ts} +1 -1
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/{operations → src/operations}/arithmetic.d.ts +0 -0
- package/dist/types/src/operations/arithmetic.d.ts.map +1 -0
- package/dist/types/{operations → src/operations}/bitwise.d.ts +0 -0
- package/dist/types/src/operations/bitwise.d.ts.map +1 -0
- package/dist/types/{operations → src/operations}/comparison.d.ts +0 -0
- package/dist/types/src/operations/comparison.d.ts.map +1 -0
- package/dist/types/{operations → src/operations}/conversion.d.ts +0 -0
- package/dist/types/src/operations/conversion.d.ts.map +1 -0
- package/dist/types/{operations → src/operations}/factorial.d.ts +0 -0
- package/dist/types/src/operations/factorial.d.ts.map +1 -0
- package/dist/types/{operations → src/operations}/index.d.ts +0 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/{operations → src/operations}/power.d.ts +0 -0
- package/dist/types/src/operations/power.d.ts.map +1 -0
- package/dist/types/{storage → src/storage}/Heap.d.ts +0 -0
- package/dist/types/src/storage/Heap.d.ts.map +1 -0
- package/dist/types/{storage → src/storage}/index.d.ts +0 -0
- package/dist/types/src/storage/index.d.ts.map +1 -0
- package/dist/types/{structures → src/structures}/ackermann.d.ts +0 -0
- package/dist/types/src/structures/ackermann.d.ts.map +1 -0
- package/dist/types/{structures → src/structures}/big-array.d.ts +0 -0
- package/dist/types/src/structures/big-array.d.ts.map +1 -0
- package/dist/types/{structures → src/structures}/index.d.ts +0 -0
- package/dist/types/src/structures/index.d.ts.map +1 -0
- package/dist/types/{structures → src/structures}/number-tree.d.ts +0 -0
- package/dist/types/src/structures/number-tree.d.ts.map +1 -0
- package/dist/types/{structures → src/structures}/power-tower.d.ts +0 -0
- package/dist/types/src/structures/power-tower.d.ts.map +1 -0
- package/dist/types/{utils → src/utils}/formatting.d.ts +0 -0
- package/dist/types/src/utils/formatting.d.ts.map +1 -0
- package/dist/types/{utils → src/utils}/index.d.ts +0 -0
- package/dist/types/src/utils/index.d.ts.map +1 -0
- package/dist/types/{utils → src/utils}/parser.d.ts +0 -0
- package/dist/types/src/utils/parser.d.ts.map +1 -0
- package/dist/types/{utils → src/utils}/precision.d.ts +0 -0
- package/dist/types/src/utils/precision.d.ts.map +1 -0
- package/dist/types/{utils → src/utils}/validation.d.ts +0 -0
- package/dist/types/src/utils/validation.d.ts.map +1 -0
- package/package.json +169 -164
- package/rollup.config.js +163 -161
- package/src/cli/hypernum.js +272 -0
- package/src/config/config-loader.ts +0 -0
- package/src/config/config-parser.ts +160 -160
- package/src/config/config-resolver.ts +0 -0
- package/src/config/config-source.ts +0 -0
- package/src/config/index.ts +0 -0
- package/src/core/common.ts +184 -184
- package/src/core/config.ts +392 -392
- package/src/core/constants.ts +101 -101
- package/src/core/errors.ts +202 -202
- package/src/core/hypernum.ts +240 -240
- package/src/core/index.ts +4 -4
- package/src/index.ts +179 -182
- package/src/operations/arithmetic.ts +332 -332
- package/src/operations/bitwise.ts +366 -366
- package/src/operations/comparison.ts +271 -271
- package/src/operations/conversion.ts +399 -399
- package/src/operations/factorial.ts +278 -278
- package/src/operations/index.ts +4 -4
- package/src/operations/power.ts +315 -315
- package/src/storage/Heap.ts +237 -237
- package/src/storage/index.ts +0 -0
- package/src/structures/ackermann.ts +232 -232
- package/src/structures/big-array.ts +305 -305
- package/src/structures/index.ts +3 -3
- package/src/structures/number-tree.ts +403 -403
- package/src/structures/power-tower.ts +277 -277
- package/src/types/common.d.ts +356 -356
- package/src/types/core.d.ts +160 -160
- package/src/types/index.d.ts +1 -1
- package/src/utils/formatting.ts +245 -245
- package/src/utils/index.ts +4 -4
- package/src/utils/parser.ts +244 -244
- package/src/utils/precision.ts +216 -216
- package/src/utils/validation.ts +182 -182
- package/tsconfig.json +83 -83
- package/dist/types/config/config-loader.d.ts.map +0 -1
- package/dist/types/config/config-parser.d.ts.map +0 -1
- package/dist/types/config/config-resolver.d.ts.map +0 -1
- package/dist/types/config/config-source.d.ts.map +0 -1
- package/dist/types/config/index.d.ts.map +0 -1
- package/dist/types/core/common.d.ts.map +0 -1
- package/dist/types/core/config.d.ts.map +0 -1
- package/dist/types/core/constants.d.ts.map +0 -1
- package/dist/types/core/errors.d.ts.map +0 -1
- package/dist/types/core/hypernum.d.ts.map +0 -1
- package/dist/types/core/index.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/operations/arithmetic.d.ts.map +0 -1
- package/dist/types/operations/bitwise.d.ts.map +0 -1
- package/dist/types/operations/comparison.d.ts.map +0 -1
- package/dist/types/operations/conversion.d.ts.map +0 -1
- package/dist/types/operations/factorial.d.ts.map +0 -1
- package/dist/types/operations/index.d.ts.map +0 -1
- package/dist/types/operations/power.d.ts.map +0 -1
- package/dist/types/storage/Heap.d.ts.map +0 -1
- package/dist/types/storage/index.d.ts.map +0 -1
- package/dist/types/structures/ackermann.d.ts.map +0 -1
- package/dist/types/structures/big-array.d.ts.map +0 -1
- package/dist/types/structures/index.d.ts.map +0 -1
- package/dist/types/structures/number-tree.d.ts.map +0 -1
- package/dist/types/structures/power-tower.d.ts.map +0 -1
- package/dist/types/utils/formatting.d.ts.map +0 -1
- package/dist/types/utils/index.d.ts.map +0 -1
- package/dist/types/utils/parser.d.ts.map +0 -1
- package/dist/types/utils/precision.d.ts.map +0 -1
- package/dist/types/utils/validation.d.ts.map +0 -1
package/src/types/core.d.ts
CHANGED
|
@@ -1,161 +1,161 @@
|
|
|
1
|
-
|
|
2
|
-
import { RoundingMode } from '../utils/precision';
|
|
3
|
-
import {
|
|
4
|
-
CacheConfig,
|
|
5
|
-
MathConstantsConfig,
|
|
6
|
-
FormatOptions,
|
|
7
|
-
DebugConfig
|
|
8
|
-
} from './common';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Basic configuration options for simple usage
|
|
12
|
-
*/
|
|
13
|
-
export interface BasicConfig {
|
|
14
|
-
/** Decimal precision for operations */
|
|
15
|
-
precision?: number;
|
|
16
|
-
/** Rounding mode for decimal operations */
|
|
17
|
-
roundingMode?: RoundingMode;
|
|
18
|
-
/** Whether to check for overflow */
|
|
19
|
-
checkOverflow?: boolean;
|
|
20
|
-
/** Maximum allowed computation steps */
|
|
21
|
-
maxSteps?: number;
|
|
22
|
-
/** Enable debug mode */
|
|
23
|
-
debug?: boolean;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Configuration for arithmetic operations
|
|
28
|
-
*/
|
|
29
|
-
export interface ArithmeticConfig {
|
|
30
|
-
/** Default precision for decimal operations */
|
|
31
|
-
defaultPrecision: number;
|
|
32
|
-
/** Default rounding mode */
|
|
33
|
-
defaultRoundingMode: RoundingMode;
|
|
34
|
-
/** Whether to check for overflow by default */
|
|
35
|
-
checkOverflow: boolean;
|
|
36
|
-
/** Maximum steps for iterative calculations */
|
|
37
|
-
maxComputationSteps: number;
|
|
38
|
-
/** Configure automatic precision adjustment */
|
|
39
|
-
autoPrecision: {
|
|
40
|
-
enabled: boolean;
|
|
41
|
-
maxPrecision: number;
|
|
42
|
-
minPrecision: number;
|
|
43
|
-
};
|
|
44
|
-
/** Constants calculation configuration */
|
|
45
|
-
constants: MathConstantsConfig;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Configuration for data structures
|
|
50
|
-
*/
|
|
51
|
-
export interface DataStructuresConfig {
|
|
52
|
-
/** Array configuration */
|
|
53
|
-
array: {
|
|
54
|
-
initialCapacity: number;
|
|
55
|
-
growthFactor: number;
|
|
56
|
-
maxSize: number;
|
|
57
|
-
};
|
|
58
|
-
/** Tree configuration */
|
|
59
|
-
tree: {
|
|
60
|
-
maxDepth: number;
|
|
61
|
-
autoBalance: boolean;
|
|
62
|
-
nodeLimit: number;
|
|
63
|
-
};
|
|
64
|
-
/** Heap configuration */
|
|
65
|
-
heap: {
|
|
66
|
-
initialCapacity: number;
|
|
67
|
-
growthPolicy: 'double' | 'linear' | 'fibonacci';
|
|
68
|
-
validatePropertyOnOperation: boolean;
|
|
69
|
-
};
|
|
70
|
-
/** Cache configuration */
|
|
71
|
-
cache: CacheConfig & {
|
|
72
|
-
enabled: boolean;
|
|
73
|
-
persistToDisk: boolean;
|
|
74
|
-
compressionEnabled: boolean;
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Configuration for number formatting
|
|
80
|
-
*/
|
|
81
|
-
export interface FormattingConfig extends FormatOptions {
|
|
82
|
-
/** Scientific notation configuration */
|
|
83
|
-
scientific: {
|
|
84
|
-
minExponent: number;
|
|
85
|
-
maxSignificantDigits: number;
|
|
86
|
-
exponentSeparator: string;
|
|
87
|
-
};
|
|
88
|
-
/** Engineering notation configuration */
|
|
89
|
-
engineering: {
|
|
90
|
-
useSIPrefixes: boolean;
|
|
91
|
-
customUnits?: Map<number, string>;
|
|
92
|
-
};
|
|
93
|
-
/** Localization settings */
|
|
94
|
-
localization: {
|
|
95
|
-
locale: string;
|
|
96
|
-
numberFormat?: Intl.NumberFormatOptions;
|
|
97
|
-
useLocaleGrouping: boolean;
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Configuration for performance monitoring
|
|
103
|
-
*/
|
|
104
|
-
export interface PerformanceConfig {
|
|
105
|
-
/** Enable performance tracking */
|
|
106
|
-
enableTracking: boolean;
|
|
107
|
-
/** Sampling rate for metrics (0-1) */
|
|
108
|
-
samplingRate: number;
|
|
109
|
-
/** Performance thresholds */
|
|
110
|
-
thresholds: {
|
|
111
|
-
warnThresholdMs: number;
|
|
112
|
-
errorThresholdMs: number;
|
|
113
|
-
maxMemoryBytes: number;
|
|
114
|
-
};
|
|
115
|
-
/** Metrics collection configuration */
|
|
116
|
-
metrics: {
|
|
117
|
-
timing: boolean;
|
|
118
|
-
memory: boolean;
|
|
119
|
-
cache: boolean;
|
|
120
|
-
custom?: Map<string, (operation: any) => number>;
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Feature flags for optional functionality
|
|
126
|
-
*/
|
|
127
|
-
export interface FeatureFlags {
|
|
128
|
-
/** Enable experimental features */
|
|
129
|
-
experimentalFeatures: boolean;
|
|
130
|
-
/** Use WebAssembly implementations when available */
|
|
131
|
-
useWasm: boolean;
|
|
132
|
-
/** Enable worker thread support */
|
|
133
|
-
workerThreads: boolean;
|
|
134
|
-
/** Enable SharedArrayBuffer support */
|
|
135
|
-
sharedArrayBuffer: boolean;
|
|
136
|
-
/** Enable BigInt64Array support */
|
|
137
|
-
bigIntTypedArrays: boolean;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Complete configuration interface
|
|
142
|
-
*/
|
|
143
|
-
export interface FullConfig {
|
|
144
|
-
/** Arithmetic operation configuration */
|
|
145
|
-
arithmetic: ArithmeticConfig;
|
|
146
|
-
/** Data structure configuration */
|
|
147
|
-
dataStructures: DataStructuresConfig;
|
|
148
|
-
/** Formatting configuration */
|
|
149
|
-
formatting: FormattingConfig;
|
|
150
|
-
/** Performance configuration */
|
|
151
|
-
performance: PerformanceConfig;
|
|
152
|
-
/** Debug configuration */
|
|
153
|
-
debug: DebugConfig;
|
|
154
|
-
/** Feature flags */
|
|
155
|
-
features: FeatureFlags;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Combined configuration type that can be either basic or full
|
|
160
|
-
*/
|
|
1
|
+
|
|
2
|
+
import { RoundingMode } from '../utils/precision';
|
|
3
|
+
import {
|
|
4
|
+
CacheConfig,
|
|
5
|
+
MathConstantsConfig,
|
|
6
|
+
FormatOptions,
|
|
7
|
+
DebugConfig
|
|
8
|
+
} from './common';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Basic configuration options for simple usage
|
|
12
|
+
*/
|
|
13
|
+
export interface BasicConfig {
|
|
14
|
+
/** Decimal precision for operations */
|
|
15
|
+
precision?: number;
|
|
16
|
+
/** Rounding mode for decimal operations */
|
|
17
|
+
roundingMode?: RoundingMode;
|
|
18
|
+
/** Whether to check for overflow */
|
|
19
|
+
checkOverflow?: boolean;
|
|
20
|
+
/** Maximum allowed computation steps */
|
|
21
|
+
maxSteps?: number;
|
|
22
|
+
/** Enable debug mode */
|
|
23
|
+
debug?: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Configuration for arithmetic operations
|
|
28
|
+
*/
|
|
29
|
+
export interface ArithmeticConfig {
|
|
30
|
+
/** Default precision for decimal operations */
|
|
31
|
+
defaultPrecision: number;
|
|
32
|
+
/** Default rounding mode */
|
|
33
|
+
defaultRoundingMode: RoundingMode;
|
|
34
|
+
/** Whether to check for overflow by default */
|
|
35
|
+
checkOverflow: boolean;
|
|
36
|
+
/** Maximum steps for iterative calculations */
|
|
37
|
+
maxComputationSteps: number;
|
|
38
|
+
/** Configure automatic precision adjustment */
|
|
39
|
+
autoPrecision: {
|
|
40
|
+
enabled: boolean;
|
|
41
|
+
maxPrecision: number;
|
|
42
|
+
minPrecision: number;
|
|
43
|
+
};
|
|
44
|
+
/** Constants calculation configuration */
|
|
45
|
+
constants: MathConstantsConfig;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Configuration for data structures
|
|
50
|
+
*/
|
|
51
|
+
export interface DataStructuresConfig {
|
|
52
|
+
/** Array configuration */
|
|
53
|
+
array: {
|
|
54
|
+
initialCapacity: number;
|
|
55
|
+
growthFactor: number;
|
|
56
|
+
maxSize: number;
|
|
57
|
+
};
|
|
58
|
+
/** Tree configuration */
|
|
59
|
+
tree: {
|
|
60
|
+
maxDepth: number;
|
|
61
|
+
autoBalance: boolean;
|
|
62
|
+
nodeLimit: number;
|
|
63
|
+
};
|
|
64
|
+
/** Heap configuration */
|
|
65
|
+
heap: {
|
|
66
|
+
initialCapacity: number;
|
|
67
|
+
growthPolicy: 'double' | 'linear' | 'fibonacci';
|
|
68
|
+
validatePropertyOnOperation: boolean;
|
|
69
|
+
};
|
|
70
|
+
/** Cache configuration */
|
|
71
|
+
cache: CacheConfig & {
|
|
72
|
+
enabled: boolean;
|
|
73
|
+
persistToDisk: boolean;
|
|
74
|
+
compressionEnabled: boolean;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Configuration for number formatting
|
|
80
|
+
*/
|
|
81
|
+
export interface FormattingConfig extends FormatOptions {
|
|
82
|
+
/** Scientific notation configuration */
|
|
83
|
+
scientific: {
|
|
84
|
+
minExponent: number;
|
|
85
|
+
maxSignificantDigits: number;
|
|
86
|
+
exponentSeparator: string;
|
|
87
|
+
};
|
|
88
|
+
/** Engineering notation configuration */
|
|
89
|
+
engineering: {
|
|
90
|
+
useSIPrefixes: boolean;
|
|
91
|
+
customUnits?: Map<number, string>;
|
|
92
|
+
};
|
|
93
|
+
/** Localization settings */
|
|
94
|
+
localization: {
|
|
95
|
+
locale: string;
|
|
96
|
+
numberFormat?: Intl.NumberFormatOptions;
|
|
97
|
+
useLocaleGrouping: boolean;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Configuration for performance monitoring
|
|
103
|
+
*/
|
|
104
|
+
export interface PerformanceConfig {
|
|
105
|
+
/** Enable performance tracking */
|
|
106
|
+
enableTracking: boolean;
|
|
107
|
+
/** Sampling rate for metrics (0-1) */
|
|
108
|
+
samplingRate: number;
|
|
109
|
+
/** Performance thresholds */
|
|
110
|
+
thresholds: {
|
|
111
|
+
warnThresholdMs: number;
|
|
112
|
+
errorThresholdMs: number;
|
|
113
|
+
maxMemoryBytes: number;
|
|
114
|
+
};
|
|
115
|
+
/** Metrics collection configuration */
|
|
116
|
+
metrics: {
|
|
117
|
+
timing: boolean;
|
|
118
|
+
memory: boolean;
|
|
119
|
+
cache: boolean;
|
|
120
|
+
custom?: Map<string, (operation: any) => number>;
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Feature flags for optional functionality
|
|
126
|
+
*/
|
|
127
|
+
export interface FeatureFlags {
|
|
128
|
+
/** Enable experimental features */
|
|
129
|
+
experimentalFeatures: boolean;
|
|
130
|
+
/** Use WebAssembly implementations when available */
|
|
131
|
+
useWasm: boolean;
|
|
132
|
+
/** Enable worker thread support */
|
|
133
|
+
workerThreads: boolean;
|
|
134
|
+
/** Enable SharedArrayBuffer support */
|
|
135
|
+
sharedArrayBuffer: boolean;
|
|
136
|
+
/** Enable BigInt64Array support */
|
|
137
|
+
bigIntTypedArrays: boolean;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Complete configuration interface
|
|
142
|
+
*/
|
|
143
|
+
export interface FullConfig {
|
|
144
|
+
/** Arithmetic operation configuration */
|
|
145
|
+
arithmetic: ArithmeticConfig;
|
|
146
|
+
/** Data structure configuration */
|
|
147
|
+
dataStructures: DataStructuresConfig;
|
|
148
|
+
/** Formatting configuration */
|
|
149
|
+
formatting: FormattingConfig;
|
|
150
|
+
/** Performance configuration */
|
|
151
|
+
performance: PerformanceConfig;
|
|
152
|
+
/** Debug configuration */
|
|
153
|
+
debug: DebugConfig;
|
|
154
|
+
/** Feature flags */
|
|
155
|
+
features: FeatureFlags;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Combined configuration type that can be either basic or full
|
|
160
|
+
*/
|
|
161
161
|
export type HypernumConfig = BasicConfig | FullConfig;
|
package/src/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './common';
|
|
1
|
+
export * from './common';
|
|
2
2
|
export * from './core'
|