fuhsnn / slimcc

C11 compiler with GNU extensions for x86-64 Linux, working towards C23
MIT License
39 stars 6 forks source link

Wrong constant evaluation of floating-point comparison and logical-not #55

Closed fuhsnn closed 8 months ago

fuhsnn commented 8 months ago
#include <stdio.h>
int fpeq = 0.1 == 0.2;
int fpnot = !0.1;
int main(void) {
  printf("%d,%d\n", fpeq, fpnot); // expected 0,0; got 1,1
}
fuhsnn commented 8 months ago

Fixed with e6a28692f4f52a7b76bdfd9a05ec50d79c31f547 and 900c7e3d120f38bc54b0770c14d031f7891e1c6f