Skip to content

Commit

Permalink
Merge pull request #275 from hvdijk/log2_39f6
Browse files Browse the repository at this point in the history
Fix boundary case in log2_extended_precision_half_safe.
  • Loading branch information
hvdijk authored Jan 3, 2024
2 parents 6a4d6b9 + 90cf2fa commit ba61522
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ T log2_extended_precision_half_safe(const T &x, T *ans_lo, T *hiExp, T *loExp) {

// Single awkward boundary value fix:
const SignedType edge(abacus::detail::cast::as<UnsignedType>(x) == 0x39f6);
remainder = __abacus_select(remainder, T(-0.000144362f16), edge);
// -0.14783 ==> -0.000144362 * 2^10
remainder = __abacus_select(remainder, T(-0.14783f16), edge);

// Set return parameters
*hiExp = abacus::detail::cast::convert<T>(hiExpI);
Expand Down

0 comments on commit ba61522

Please sign in to comment.