Skip to content

Commit 4ca9710

Browse files
committed
Java, C#: Enhance shortenMantissa function description
1 parent 53bb814 commit 4ca9710

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

csharp/EPAM.Deltix.DFP/Decimal64.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,11 @@ public Decimal64 RoundToNearestTiesToEven(Decimal64 multiple)
823823
/// This function attempts to find the number with the maximum count of trailing zeros
824824
/// within the neighborhood range [mantissa-delta ... mantissa+delta].
825825
/// If the number of trailing zeros is less than minZerosCount, the original value is returned.
826+
/// The delta argument determines how far new values can be from the input value.
827+
/// It defines the region within which candidates are searched.
828+
/// Once the best candidate within the search region is found, it is checked to determine if the candidate is good enough.
829+
/// The good candidate must have at least minZerosCount trailing zeros.
830+
/// If this is true, the new value with a shortened mantissa is returned; otherwise, the original input value is returned.
826831
/// For the examples above the
827832
/// Decimal64.FromDouble(12.3456).ShortenMantissa(4, 1) => 12.3456
828833
/// Decimal64.FromDouble(720491.5510000001).ShortenMantissa(4, 1) => 720491.551

java/dfp/src/main/java/com/epam/deltix/dfp/Decimal64.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,11 @@ public Decimal64 average(final Decimal64 other) {
729729
* This function attempts to find the number with the maximum count of trailing zeros
730730
* within the neighborhood range [mantissa-delta ... mantissa+delta].
731731
* If the number of trailing zeros is less than minZerosCount, the original value is returned.
732+
* The delta argument determines how far new values can be from the input value.
733+
* It defines the region within which candidates are searched.
734+
* Once the best candidate within the search region is found, it is checked to determine if the candidate is good enough.
735+
* The good candidate must have at least minZerosCount trailing zeros.
736+
* If this is true, the new value with a shortened mantissa is returned; otherwise, the original input value is returned.
732737
* For the examples above the
733738
* Decimal64.fromDouble(12.3456).shortenMantissa(4, 1) => 12.3456
734739
* Decimal64.fromDouble(720491.5510000001).shortenMantissa(4, 1) => 720491.551

java/dfp/src/main/java/com/epam/deltix/dfp/Decimal64Utils.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,11 @@ public static long mean(@Decimal final long a, @Decimal final long b) {
864864
* This function attempts to find the number with the maximum count of trailing zeros
865865
* within the neighborhood range [mantissa-delta ... mantissa+delta].
866866
* If the number of trailing zeros is less than minZerosCount, the original value is returned.
867+
* The delta argument determines how far new values can be from the input value.
868+
* It defines the region within which candidates are searched.
869+
* Once the best candidate within the search region is found, it is checked to determine if the candidate is good enough.
870+
* The good candidate must have at least minZerosCount trailing zeros.
871+
* If this is true, the new value with a shortened mantissa is returned; otherwise, the original input value is returned.
867872
* For the examples above the
868873
* Decimal64.fromDouble(12.3456).shortenMantissa(4, 1) => 12.3456
869874
* Decimal64.fromDouble(720491.5510000001).shortenMantissa(4, 1) => 720491.551

0 commit comments

Comments
 (0)