Skip to content

Commit 95f683e

Browse files
📚 docs(code): Add some comments for future ref.
1 parent 359631a commit 95f683e

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/Integer.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export class Integer {
3535
}
3636

3737
_limbs_in_base ( base ) {
38+
// TODO save result for later ? Maybe replace base ?
3839
if ( this.base === base ) return this.limbs ;
3940
else return convert( this.base , base , this.limbs , 0 , this.limbs.length ) ;
4041
}
@@ -222,11 +223,13 @@ export class Integer {
222223

223224
square ( ) {
224225
// TODO optimize but be careful with side effects
226+
// TODO use this.mul(this) instead?
225227
return this.pow(2);
226228
}
227229

228230
isquare ( ) {
229231
// TODO optimize but be careful with side effects
232+
// TODO use this.imul(this) instead?
230233
return this.ipow(2);
231234
}
232235

@@ -370,6 +373,8 @@ export class Integer {
370373
}
371374

372375
digits ( base = DEFAULT_DISPLAY_BASE ) {
376+
// TODO Once #to is implemented we can rewrite this as
377+
// return this.to(LITTLE_ENDIAN, base, Array) ;
373378
return convert( this.base , base , this.limbs , 0 , this.limbs.length ).reverse( ) ;
374379
}
375380

@@ -382,6 +387,7 @@ export class Integer {
382387
}
383388

384389
divide_knowing_divisible_by ( other ) {
390+
// TODO optimize
385391
return this.div( other ) ;
386392
}
387393

src/IntegerRing.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export class IntegerRing {
8787
}
8888

8989
$0 ( ) {
90+
// TODO Could we use an empty array instead ?
9091
return new Integer( this.base , 0 , [ 0 ] ) ;
9192
}
9293

0 commit comments

Comments
 (0)