NerdLang / nerd

🔱 Javascript's God Mode. No VM. No Bytecode. No GC. Just native binaries.
https://nectarjs.com
MIT License
3.58k stars 127 forks source link

Semantics of division by zero differ from JS #136

Closed DirtyHairy closed 1 year ago

DirtyHairy commented 3 years ago
console.log(1/0);

NodeJS:

$ node infinity.js
Infinity

Nectar:

$ nectar --run infinity.js
[*] Generating source file
[*] Compiling with preset: speed
/Users/pestix/dumpster/nectar/.nectar/dsjxg/infinity.cpp:321:18: warning: division by zero is undefined [-Wdivision-by-zero]
console["log"](1 / 0);
                 ^ ~
1 warning generated.
ld: warning: option -s is obsolete and being ignored

[*] Executing /Users/pestix/dumpster/nectar/infinity
103