@@ -13,24 +13,24 @@ export const fromStringAsImpl = function (just) {
13
13
return function ( radix ) {
14
14
return function ( _value ) {
15
15
16
- // Preprocess for potentially negative numbers. Since the toString
17
- // function simply prepends a '-' character for negative numbers,
16
+ // Preprocess for potentially negative numbers. Since the toString
17
+ // function simply prepends a '-' character for negative numbers,
18
18
// we need this to make fromStringAs an inverse function.
19
19
var value , op ;
20
20
if ( _value [ 0 ] === "-" ) {
21
- op = function ( v ) { return BigInt ( - 1 ) * v } ;
21
+ op = function ( v ) { return BigInt ( - 1 ) * v } ;
22
22
value = _value . slice ( 1 ) ;
23
23
} else {
24
- op = function ( v ) { return v } ;
24
+ op = function ( v ) { return v } ;
25
25
value = _value ;
26
26
}
27
27
28
28
value . replace ( / ^ 0 + / , '' )
29
29
30
30
var size = 6 ,
31
- factor = BigInt ( radix ** size ) ,
32
- i = value . length % size || size ,
33
- parts = [ value . slice ( 0 , i ) ] ;
31
+ factor = BigInt ( radix ** size ) ,
32
+ i = value . length % size || size ,
33
+ parts = [ value . slice ( 0 , i ) ] ;
34
34
35
35
while ( i < value . length ) parts . push ( value . slice ( i , i += size ) ) ;
36
36
@@ -42,7 +42,7 @@ export const fromStringAsImpl = function (just) {
42
42
return acc * factor + BigInt ( n ) ;
43
43
}
44
44
} ;
45
-
45
+
46
46
try {
47
47
return just ( op ( parts . reduce ( f , 0n ) ) ) ;
48
48
} catch ( err ) {
@@ -87,14 +87,13 @@ export const biDiv = (x) => (y) => {
87
87
88
88
export const biDegree = ( x ) => {
89
89
return x < 0n ? - x : x ;
90
-
91
90
}
92
91
93
92
export const biZero = 0n ;
94
93
95
94
export const biOne = 1n ;
96
95
97
- export const pow = ( x ) => ( y ) => y >= 0n ? x ** y : 0n ;
96
+ export const pow = ( x ) => ( y ) => y >= 0n ? x ** y : 0n ;
98
97
99
98
export const not = ( x ) => ~ x ;
100
99
0 commit comments