Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 4379001

Browse files
authored
Remainder operation rounding (#104)
* Remove rounding mode option to `remainder` Not needed. * Document the remainder change
1 parent 900d4a7 commit 4379001

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [12.2.0] - 2024-04-15
11+
12+
### Changed
13+
14+
- The remainder operation no longer takes an optional argument for specifying the rounding mode. It is unnecessary.
15+
1016
## [12.1.0] - 2024-04-11
1117

1218
### Added

src/decimal128.mts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1534,10 +1534,9 @@ export class Decimal128 {
15341534
* Return the remainder of this Decimal128 value divided by another Decimal128 value.
15351535
*
15361536
* @param d
1537-
* @param opts
15381537
* @throws RangeError If argument is zero
15391538
*/
1540-
remainder(d: Decimal128, opts?: ArithmeticOperationOptions): Decimal128 {
1539+
remainder(d: Decimal128): Decimal128 {
15411540
if (this.isNaN || d.isNaN) {
15421541
return new Decimal128(NAN);
15431542
}
@@ -1563,7 +1562,7 @@ export class Decimal128 {
15631562
}
15641563

15651564
let q = this.divide(d).round(0, ROUNDING_MODE_TRUNCATE);
1566-
return this.subtract(d.multiply(q), opts);
1565+
return this.subtract(d.multiply(q));
15671566
}
15681567

15691568
private decrementExponent(): Decimal128 {

0 commit comments

Comments
 (0)