arturobernalg commented on code in PR #113:
URL: https://github.com/apache/commons-rng/pull/113#discussion_r883107322
##########
commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSampler.java:
##########
@@ -196,17 +196,10 @@ 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;
- }
- } else {
- // Same signs, subtraction will count the ULP difference.
- // This should be above 1.
- if (Math.abs(bitsx - bitsy) < MIN_ULP_SAME_SIGN) {
- return false;
- }
+ return !lessThanUnsigned(bitsx + bitsy, MIN_ULP_OPPOSITE_SIGN);
}
- return true;
+ // maintain existing comment ...
Review Comment:
if the code need comment, probably need to fixed.
Changed
--
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]