summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSadeep Madurange <smadurange@users.noreply.github.com>2021-11-29 22:21:22 +0800
committerSadeep Madurange <smadurange@users.noreply.github.com>2021-11-29 22:21:22 +0800
commit5bde5a8dc109a0e3f8a3e31b7ffb4bd0894bef57 (patch)
treeb82e97d6c4c50144cd2767f3778828d8e74f66c1
parentddf64d68df02f7ea551e89c1aa106b54cb88849b (diff)
downloadk&r-exercises-5bde5a8dc109a0e3f8a3e31b7ffb4bd0894bef57.tar.gz
2.6
-rw-r--r--2/6.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/2/6.c b/2/6.c
index 6100cf7..d311002 100644
--- a/2/6.c
+++ b/2/6.c
@@ -25,7 +25,7 @@ unsigned setbits(unsigned x, int p, int n, unsigned y) {
// align extracted bits to p:
yLOA = yLO << (p + 1 - n);
- // create mask for x
+ // maks to unset n bits starting at p:
xUnset = (~0 << p) | ~(~0 << (p - n));
// mask out n bits in x from pth position: