@@ -3,9 +3,9 @@ import { DEFAULT_DISPLAY_BASE , ZeroDivisionError } from './' ;
3
3
import {
4
4
stringify , convert , _trim_positive ,
5
5
_alloc , _copy , _zeros ,
6
- _jz , _cmp , _eq ,
6
+ jz , cmp , eq ,
7
7
add , _sub , mul , _idivmod , _pow_double ,
8
- _increment ,
8
+ increment ,
9
9
} from '@aureooms/js-integer-big-endian' ;
10
10
11
11
export class Integer {
@@ -103,7 +103,7 @@ export class Integer {
103
103
104
104
if ( bi >= bj ) return this . copy ( ) ;
105
105
106
- if ( _cmp ( a , ai , aj , b , bi , bj ) < 0 ) {
106
+ if ( cmp ( a , ai , aj , b , bi , bj ) < 0 ) {
107
107
108
108
const c = _zeros ( bj - bi ) ;
109
109
@@ -237,12 +237,12 @@ export class Integer {
237
237
const Q = new Integer ( r , quotient_is_negative , q ) ; // quotient
238
238
const R = new Integer ( r , 0 , D ) ; // remainder
239
239
240
- if ( ( this . is_negative || other . is_negative ) && ! _jz ( D , 0 , D . length ) ) {
240
+ if ( ( this . is_negative || other . is_negative ) && ! jz ( D , 0 , D . length ) ) {
241
241
242
242
if ( other . is_negative ) {
243
243
244
244
if ( ! this . is_negative ) {
245
- _increment ( r , q , 0 , q . length ) ;
245
+ increment ( r , q , 0 , q . length ) ;
246
246
R . iadd ( other ) ; // TODO optimize
247
247
}
248
248
@@ -253,7 +253,7 @@ export class Integer {
253
253
}
254
254
255
255
else {
256
- _increment ( r , q , 0 , q . length ) ;
256
+ increment ( r , q , 0 , q . length ) ;
257
257
R . negate ( ) . iadd ( other ) ; // TODO optimize
258
258
}
259
259
@@ -277,12 +277,12 @@ export class Integer {
277
277
}
278
278
279
279
iszero ( ) {
280
- return _jz ( this . limbs , 0 , this . limbs . length ) ;
280
+ return jz ( this . limbs , 0 , this . limbs . length ) ;
281
281
}
282
282
283
283
isone ( ) {
284
284
if ( this . is_negative ) return false ;
285
- return _eq ( this . limbs , 0 , this . limbs . length , [ 1 ] , 0 , 1 ) ;
285
+ return eq ( this . limbs , 0 , this . limbs . length , [ 1 ] , 0 , 1 ) ;
286
286
}
287
287
288
288
nonzero ( ) {
@@ -333,7 +333,7 @@ export class Integer {
333
333
const a = this . limbs ;
334
334
const b = other . _limbs_in_base ( this . base ) ;
335
335
336
- return _cmp ( a , 0 , a . length , b , 0 , b . length ) ;
336
+ return cmp ( a , 0 , a . length , b , 0 , b . length ) ;
337
337
338
338
}
339
339
0 commit comments