diff options
Diffstat (limited to 'guava-tests/benchmark/com/google/common/math/BigIntegerMathRoundingBenchmark.java')
-rw-r--r-- | guava-tests/benchmark/com/google/common/math/BigIntegerMathRoundingBenchmark.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/guava-tests/benchmark/com/google/common/math/BigIntegerMathRoundingBenchmark.java b/guava-tests/benchmark/com/google/common/math/BigIntegerMathRoundingBenchmark.java index e8616ee55..be387f792 100644 --- a/guava-tests/benchmark/com/google/common/math/BigIntegerMathRoundingBenchmark.java +++ b/guava-tests/benchmark/com/google/common/math/BigIntegerMathRoundingBenchmark.java @@ -88,4 +88,14 @@ public class BigIntegerMathRoundingBenchmark { } return tmp; } + + @Benchmark + long roundToDouble(int reps) { + long tmp = 0; + for (int i = 0; i < reps; i++) { + int j = i & ARRAY_MASK; + tmp += Double.doubleToRawLongBits(BigIntegerMath.roundToDouble(nonzero1[j], mode)); + } + return tmp; + } } |