Skip to content

Commit 6c9b905

Browse files
💥 BREAKING CHANGE(idivmod): Move to remainder instead of quotient.
1 parent 9e68e25 commit 6c9b905

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Integer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ export class Integer {
333333
idivmod ( other ) {
334334
// TODO optimize but be careful with side effects
335335
const [ q , r ] = this.divmod(other) ;
336-
return [ q.move(this) , r ] ;
336+
return [ q , r.move(this) ] ;
337337
}
338338

339339
opposite ( ) {

test/src/Integer/divmod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function macro ( t , a , b , q , r ) {
99

1010
t.is(q.toString(), Q.toString()) ;
1111
t.is(r.toString(), R.toString()) ;
12-
t.is(q.toString(), A.toString()) ;
12+
t.is(r.toString(), A.toString()) ;
1313
}
1414

1515
macro.title = ( providedTitle , a , b , q , r ) => `${a} idivmod ${b} = [${q}, ${r}]` ;

0 commit comments

Comments
 (0)