aherbert commented on code in PR #113:
URL: https://github.com/apache/commons-rng/pull/113#discussion_r883036288
##########
commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSampler.java:
##########
@@ -196,17 +196,12 @@ private static boolean validateOpenInterval(double lo,
double hi) {
// (MAX_VALUE has all bits set except the most significant sign
bit.)
bitsx &= Long.MAX_VALUE;
bitsy &= Long.MAX_VALUE;
- if (lessThanUnsigned(bitsx + bitsy, MIN_ULP_OPPOSITE_SIGN)) {
- return false;
- }
+ return !lessThanUnsigned(bitsx + bitsy, MIN_ULP_OPPOSITE_SIGN);
} else {
Review Comment:
With this simplification the else statement is not required. Can you update
to:
```Java
return !lessThanUnsigned(bitsx + bitsy, MIN_ULP_OPPOSITE_SIGN);
}
// maintain existing comment ...
return Math.abs(bitsx - bitsy) >= MIN_ULP_SAME_SIGN;
```
--
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]