diff options
| author | Sadeep Madurange <smadurange@users.noreply.github.com> | 2021-11-29 22:16:35 +0800 |
|---|---|---|
| committer | Sadeep Madurange <smadurange@users.noreply.github.com> | 2021-11-29 22:16:35 +0800 |
| commit | d185cab856f8fa71e8ea28cbc38c996f6487f1e2 (patch) | |
| tree | 13a73d151a41c0775c637f6d255d85841d0a4a4a /2 | |
| parent | 3147770dcec9f76d7137a5e05389ccdeed9a86df (diff) | |
| download | k&r-exercises-d185cab856f8fa71e8ea28cbc38c996f6487f1e2.tar.gz | |
2.6
Diffstat (limited to '2')
| -rw-r--r-- | 2/6.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -25,7 +25,7 @@ unsigned setbits(unsigned x, int p, int n, unsigned y) { // align extracted bits to p: yLOA = yLO << (p + 1 - n); - // mask with n bits from p unset: + // create mask for x xUnset = (~0 << p) | ~(~0 << (p - n)); // mask out n bits in x from p: |
