Browse Source

fix quiz7

master
吴冕志 2 years ago
parent
commit
ffcbd83cde
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      lab2/datalab-handout/bits.c

+ 1
- 1
lab2/datalab-handout/bits.c View File

@ -252,7 +252,7 @@ int conditional(int x, int y, int z) {
int isLessOrEqual(int x, int y) {
int signx = x >> 31;
int signy = y >> 31;
int isnegpos = signx ^ signy & signx; // 0xFFFFF if signx = 1 sign y = 0
int isnegpos = (signx ^ signy) & (~signx); // 0xFFFFF if signx = 1 sign y = 0
int sign1 = ~(1 << 31); // 01111111...111
int absx = x & sign1;
int absy = y & sign1;

Loading…
Cancel
Save