Implemented ceil and floor in StrictMath
Translated the ceiling and floor methods from the fdlibm library into Java
to remove transition to native code for these functions. Also updated the test
cases to include corner cases such as +infinity, -infinity, NaN, and interesting
values covering all lines of code found by random testing. Additionally updated
benchmarks to cover several interesting values for both functions.
Running the new benchmarks (for each function, taking the average of several calls
with differing values that ensure full line coverage) showed improved performance.
Ceiling before = 140.91 ns
Ceiling after = 86.55 ns
Floor before = 137.33 ns
Floor after = 86.64 ns
4 files changed