UNPKG
aureooms-js-integer
Version:
latest (1.0.0)
1.0.0
0.3.2
0.3.1
0.3.0
integer code bricks for JavaScript
aureooms.github.io/js-integer
aureooms/js-integer
aureooms-js-integer
/
src
/
1-new
/
convert
/
trim_natural.js
15 lines
(8 loc)
•
256 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import
{ _trim_positive , _alloc , _copy }
from
'.'
;
export
function
trim_natural
(
a , ai , aj
) {
const
x =
_trim_positive
( a , ai , aj ) ;
if
( x >= aj )
return
[
0
] ;
const
b =
_alloc
( aj - x ) ;
_copy
( a , x , aj , b ,
0
) ;
return
b ; }