c3lang / c3c

Compiler for the C3 language
https://c3-lang.org
GNU Lesser General Public License v3.0
2.68k stars 163 forks source link

int.min behaves weirdly #1154

Closed cbuttner closed 5 months ago

cbuttner commented 7 months ago
fn void int_min() {
  io::printn(int.min); // Prints -2147483648
  io::printn((float)int.min); // Prints positive 2147483648.0
  assert(int.min == -2147483648); // Assert violation
  assert((float)int.min == -2147483648.0f); // Assert violation
}
lerno commented 7 months ago

Fixed, thank you!

cbuttner commented 5 months ago

Thanks.