Skip to content

Commit ab258bd

Browse files
🐛 fix(IntegerRing.from_string): Make zero always nonnegative.
1 parent e0ff5f8 commit ab258bd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/IntegerRing.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ export class IntegerRing {
6868

6969
const limbs = parse( base , this.base , string ) ;
7070

71+
if (limbs.length === 1 && limbs[0] === 0) is_negative = 0 ;
72+
7173
return new Integer( this.base , is_negative , limbs ) ;
7274

7375
}

0 commit comments

Comments
 (0)