Skip to content

Commit 73c9492

Browse files
🚀 perf: Max out representation base to save cycles and memory.
1 parent b11e0af commit 73c9492

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/DEFAULT_REPRESENTATION_BASE.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
import { DEFAULT_DISPLAY_BASE } from './' ;
1+
//import { DEFAULT_DISPLAY_BASE } from './' ;
2+
import { MAX_BASE } from './_limits' ;
23

34
/*
45
* Biggest power of DEFAULT_DISPLAY_BASE whose square holds in a single double
56
* with full precision. For working correctly with multiplication algorithms
67
* and for fast base DEFAULT_DISPLAY_BASE printing. On older machines with no
78
* native doubles, it might be worth to only use ints.
89
*/
9-
export const DEFAULT_REPRESENTATION_BASE = Math.pow(DEFAULT_DISPLAY_BASE,Math.floor(Math.log(Math.sqrt(Math.pow(2,53)))/Math.log(DEFAULT_DISPLAY_BASE))) ;
10+
//export const DEFAULT_REPRESENTATION_BASE = Math.pow(DEFAULT_DISPLAY_BASE,Math.floor(Math.log(Math.sqrt(Math.pow(2,53)))/Math.log(DEFAULT_DISPLAY_BASE))) ;
11+
//export const DEFAULT_REPRESENTATION_BASE = Math.pow(16,Math.floor(Math.log(Math.sqrt(Math.pow(2,53)))/Math.log(16))) ;
12+
//export const DEFAULT_REPRESENTATION_BASE = Math.pow(2,26) | 0;
13+
export const DEFAULT_REPRESENTATION_BASE = MAX_BASE;

0 commit comments

Comments
 (0)