We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bd9b089 commit f0160b7Copy full SHA for f0160b7
1 file changed
src/bigfloat.ts
@@ -462,6 +462,17 @@ export class BigFloat {
462
return(this.addSub(subtrahend, 1));
463
}
464
465
+ /** Round towards zero, to given number of base 2^32 fractional digits. */
466
+
467
+ truncate(fractionLimbCount: number) {
468
+ if(this.fractionLen > fractionLimbCount) {
469
+ this.limbList = this.limbList.slice(this.fractionLen - fractionLimbCount);
470
+ this.fractionLen = fractionLimbCount;
471
+ }
472
473
+ return(this);
474
475
476
/** Divide by integer, replacing current value by quotient. Return integer remainder. */
477
478
private divInt(divisor: number) {
0 commit comments