fuhsnn / slimcc

C11 compiler with GNU / C23 extensions for x86-64 Linux, able to build Python and PostgreSQL
MIT License
24 stars 3 forks source link

Wrong result of const-evaluated `&&` `||` with FP operand #63

Closed fuhsnn closed 5 months ago

fuhsnn commented 5 months ago
#include <stdio.h>
_Bool b1 = 0.5 && 0.3;
_Bool b2 = 0.5 || 0.3;
int main(void) {
  printf("%d\n", b1); // expected 1, got 0
  printf("%d\n", b2); // expected 1, got 0
}