Copilot commented on code in PR #677:
URL: https://github.com/apache/datasketches-java/pull/677#discussion_r2238448931
##########
src/main/java/org/apache/datasketches/count/CountMinSketch.java:
##########
@@ -184,7 +180,7 @@ public long getTotalWeight_() {
* @return The relative error.
*/
public double getRelativeError() {
- return Math.exp(1.0) / (double)numBuckets_;
+ return Math.exp(1.0) / numBuckets_;
Review Comment:
The explicit cast to double was removed, but numBuckets_ appears to be an
integer field. Without the cast, this could result in integer division if
numBuckets_ is an int, which would lose precision. Consider keeping the
explicit cast: `return Math.exp(1.0) / (double)numBuckets_;`
```suggestion
return Math.exp(1.0) / (double) numBuckets_;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]