Why didn't you try it? 
Try it! 
Yes, it returns Infinity.
Would you that error handling for every other operation, like for example 
the squareroot of negative numbers, or the logarithm of zero? I don't think 
that this is a good idea for a language like elm.


On Saturday, February 18, 2017 at 4:59:01 PM UTC+1, Rupert Smith wrote:
>
> Elm has no runtime exceptions - which is really cool, the type system 
> prevents me from coding things that can fail at runtime. But what about 
> integer division by zero?
>
> I have not tried it, but as Ints are translated as numbers in the 
> javavscript, I think diving by zero will return me a floating point 
> Infinity, yes?
>
> Should division force you to deal with failures like this
>
> case (a / b) of
>   Integer val -> ...
>   DivideByZero -> ...
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to