Add `midpoint()` calculation to folly
Summary: A number of libraries at Facebook include interval midpoint calculations; however, doing these in a mathematically precise way (without over/underflow) can be tricky. Doing them wrong can break binary searches over large datasets and give imprecise floating-point calculations. This function provides an early opportunity to fix binary searches and other calculations which can later be updated to `std::midpoint()` when C++20 becomes available. Reviewed By: yfeldblum Differential Revision: D23997097 fbshipit-source-id: 373e0dc1d1ff071f697ee782be46fb0d49a2f8f7
Showing
Please register or sign in to comment