[PATCH] D40089: [clangd] Make completion scores use 0-1 floats internally.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 23 06:51:34 PST 2017


hokein accepted this revision.
hokein added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: clangd/ClangdUnit.cpp:425
+    const uint32_t SignBit = ~(~uint32_t{0} >> 1);
+    return U & SignBit ? 0 - U : U + SignBit;
+  }
----------------
sammccall wrote:
> hokein wrote:
> > U ^ SignBit
> This matches my old explanation but isn't correct for sign-magnitude.
Well, I see! You are right. The implement is **correct** here.


https://reviews.llvm.org/D40089





More information about the cfe-commits mailing list