Currently *OverflowError* doesn't have a message field, so to do this, you 
have to either let showerror 
<https://github.com/JuliaLang/julia/blob/69a68305743a6b9a9409e7db69d955909e7006d0/base/replutil.jl#L114>
 
check the backtrace to look for *factoria*l or add a text field, so that 
factorial can add the message to the exception.

I think we eventually want all exceptions to have a string field with a 
message, but there has been raised some concerns about the performance 
overhead in some situations. It seems possible to fix that problem, but I 
don't really understand the underlying issues well enough to comment on 
that.

Ivar

onsdag 14. januar 2015 21.48.36 UTC+1 skrev ggggg følgende:
>
> Is there a way to provide a suggestion with the error?
>
> It currently says this, 
>
> *julia> **factorial(21)*
>
> *ERROR: OverflowError()*
>
> * in factorial_lookup at combinatorics.jl:27*
>
> * in factorial at combinatorics.jl:35*
>
> Maybe it would be more useful if it said
>
> *julia> **factorial(21)*
>
> *ERROR: OverflowError("perhaps you want factorial(big(21)) instead?")*
>
> * in factorial_lookup at combinatorics.jl:27*
>
> * in factorial at combinatorics.jl:35*
>
> On Wednesday, January 14, 2015 at 11:37:17 AM UTC-7, Viral Shah wrote:
>>
>> I am guessing, that like Matlab, octave uses doubles to represent 
>> integers, and hence you can go a bit farther than with integers. That 
>> should be the same as factorial(21.0) in julia. Of course, you can also use 
>> BigInt and such, which has already been discussed here.
>>
>> -viral
>>
>> On Tuesday, January 13, 2015 at 8:40:06 AM UTC+5:30, Carlos Baptista 
>> wrote:
>>>
>>> I understand that factorial(21) is quite a large number and therefore an 
>>> OverflowError is perfectly understandable. However, with Octave I can go up 
>>> to factorial(170) (if I go higher I receive Inf). Is there a way to go 
>>> beyond factorial(20) in Julia?
>>>
>>

Reply via email to