Closed Finii closed 1 year ago
Alternative implementation, which uses ULPs.
In fact we could have used return difference <= limit;
BUT that breaks with special floating point values.
So it's either the PR version, or this:
bool within_orders(const NumT a, const NumT b, const OrderT orders) noexcept(false) {
// std::pow() is not noexcept, which might or might not be true
auto difference = gul14::abs(a - b);
auto maximum = std::max(gul14::abs(a), gul14::abs(b));
auto limit = static_cast<NumT>(maximum / std::pow(static_cast<std::decay_t<NumT>>(10.0), orders));
auto ulp = std::numeric_limits<NumT>::min();
return difference < std::max(limit, ulp);
}
Before merging, maybe we should also bump the version number?
Increased version number and added git tag (this will work if we fast-forward merge) (hopefully ;-)
Obviously 'dismiss' is not the correct button :grimacing:
Before merging, maybe we should also bump the version number?
Hmm, there is no Doocs release between 2.7 and now, so maybe keep 2.7?
Ah, more appropriate would be v2.7.1
which keeps the API version at 2.7
... changing
Hmm, I do not know what Github is doing, but even a ff merge changes the commit hashes, so the tag needs to be adapted:
Sigh ...
git tag -d v2.7.1
git push github --delete v2.7.1
git pull github main
git tag -m v2.7.1 v2.7.1
git push github --tags
@alt-graph Is the mirroring automatic, or shall I push to gitlab? Not that Tim builds with the old lib :grimacing:
Mirroring is claimed but not set up??
Did it just manually ... any reason this is not automated?
Did it just manually ... any reason this is not automated?
We don't have the paid version of Gitlab, so we cannot automate it from there. We could do it from Github, I guess.
[why]
gul14::within_orders(0.0, 0.0, 5)
isfalse
. Instinctively one might expect it to be true, as both inputs are strictly equal.[how] Check for equality first, then additionally add some lenience.
Fixes: #17