Skip to content

Commit

Permalink
Add explanatory comment for kOneUlp
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou committed Dec 9, 2024
1 parent 0783571 commit b2cb305
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cpp/src/arrow/testing/math.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
namespace arrow {
namespace {

// `kOneUlp` is equal to 1.0 - (1.0 - nextafter(1.0, -inf)).
// That is, it is the delta between 1.0 and the FP value immediately before 1.0.
// We're using this value because `frexp` returns a mantissa between 0.5 and 1.0.
template <typename Float>
constexpr Float kOneUlp;
template <>
Expand Down

0 comments on commit b2cb305

Please sign in to comment.