Skip to content

Commit bbbba93

Browse files
committed
Use same method for double and open double generation performance
1 parent c7c4db8 commit bbbba93

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/core/FloatingPointGenerationPerformance.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,7 @@ public double nextDoubleUsingBitsToDouble(LongSource source) {
9999
// 0x300L = 256 + 512 = 768
100100
// 0x0ff = 255
101101
// This makes a number in the range 1.0 to 2.0 so subtract 1.0
102-
//
103-
// Note: This variant using a long constant can be slower:
104-
// Double.longBitsToDouble((source.nextLong() >>> 12) | 0x3ff0000000000001L) - 1.0
105-
// It matches the performance of nextOpenDoubleUsingBitsToDouble so is not
106-
// formally included as a variant.
107-
return Double.longBitsToDouble((source.nextLong() >>> 12) | (0x3ffL << 52)) - 1.0;
102+
return Double.longBitsToDouble((source.nextLong() >>> 12) | 0x3ff0000000000000L) - 1.0;
108103
}
109104

110105
/**

0 commit comments

Comments
 (0)