scalafiddle / scalafiddle-core

Source code for the scalafiddle.io compilation service
https://scalafiddle.io
Apache License 2.0
100 stars 37 forks source link

Incorrect result for divide by zero #19

Closed opensorceror closed 7 years ago

opensorceror commented 7 years ago

In ScalaFiddle, a divide by zero operation returns 0 when the numerator and denominator are both integers.

https://scalafiddle.io/sf/QHrybLv/1

ochrons commented 7 years ago

This is due to JS semantics and how some things are not checked by Scala.js due to performance reasons. http://www.scala-js.org/doc/semantics.html