Skip to content

Commit b2cb305

Browse files
committed
Add explanatory comment for kOneUlp
1 parent 0783571 commit b2cb305

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cpp/src/arrow/testing/math.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
namespace arrow {
2828
namespace {
2929

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

0 commit comments

Comments
 (0)