We should be doing a much better job of getting these kinds of things into the 
FAQ. I added a new section for this one:

http://docs.julialang.org/en/latest/manual/faq/#why-does-julia-give-a-
domainerror-for-perfectly-sensible-operations

--Tim

On Saturday, June 07, 2014 12:53:50 AM Ivar Nesje wrote:
> One thing that is a stupid bug is that the DomainError does not tell the
> user what domain he is outside, and that he might want to add `.` after the
> exponent in order to get a Float64 result. sqrt(-1) does a much better job
> in that regard. There are some efficiency concerns about adding a string to
> the DomainError type, and currently we fix this by checking the backtrace
> in the showerror function.
> 
> There has also been discussion on whether ^(a::Integer,b::Integer) should
> return a Float64 by default, and defer to pow() like /(a::Integer,
> b::Integer) defers to div(). The problem is that many people like the 10^45
> vs 1e45 notation for large integers vs float constants, and we can make it
> a clean error instead of a silent bug.

Reply via email to