This repository was archived by the owner on Jan 15, 2025. It is now read-only.
Commit feb47f9 1 parent c3d58cd commit feb47f9 Copy full SHA for feb47f9
File tree 2 files changed +2
-15
lines changed
2 files changed +2
-15
lines changed Original file line number Diff line number Diff line change @@ -1103,18 +1103,6 @@ export class Decimal128 {
1103
1103
return emitDecimal ( ) ;
1104
1104
}
1105
1105
1106
- /**
1107
- * Return the absolute value of this Decimal128 value.
1108
- *
1109
- */
1110
- private abs ( ) : Decimal128 {
1111
- if ( this . isNegative ) {
1112
- return new Decimal128 ( this . toString ( ) . substring ( 1 ) ) ;
1113
- }
1114
-
1115
- return this ;
1116
- }
1117
-
1118
1106
/**
1119
1107
* Compare two values. Return
1120
1108
*
@@ -1493,7 +1481,7 @@ export class Decimal128 {
1493
1481
}
1494
1482
1495
1483
let q = this . divide ( d ) . round ( 0 , ROUNDING_MODE_TRUNCATE ) ;
1496
- return this . subtract ( d . multiply ( q ) ) . abs ( ) ;
1484
+ return this . subtract ( d . multiply ( q ) ) ;
1497
1485
}
1498
1486
1499
1487
normalize ( ) : Decimal128 {
Original file line number Diff line number Diff line change @@ -140,9 +140,8 @@ export class Rational {
140
140
}
141
141
142
142
private static _multiply ( x : Rational , y : Rational ) : Rational {
143
- let neg = x . isNegative !== y . isNegative ;
144
143
return new Rational (
145
- ( neg ? minusOne : one ) * x . numerator * y . numerator ,
144
+ x . numerator * y . numerator ,
146
145
x . denominator * y . denominator
147
146
) ;
148
147
}
You can’t perform that action at this time.
0 commit comments