Skip to content

Commit 27e3216

Browse files
authored
ctutils: add citation for bitborrow! (#1573)
It can also be found in Hacker's Delight
1 parent ee6f60a commit 27e3216

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎ctutils/src/primitives.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ macro_rules! bitle {
1919
}
2020

2121
/// Outgoing borrow bit for a wrapping `x - y - borrow_in` result.
22+
///
23+
/// See "Hacker's Delight", 2nd edition, section 2-13 (Overflow detection)
2224
macro_rules! bitborrow {
2325
($x:expr, $y:expr, $result:expr, $bits:expr) => {
2426
(((!$x) & $y) | (((!$x) | $y) & $result)) >> ($bits - 1)

0 commit comments

Comments
 (0)