How to locate an error?

When I run my code, I got an error information like this:

InexactError: BigFloat(6.998928493576780755780486487083180691115558147430419921875e-05 - 0.99999998593600791796376370257348753511905670166015625im)

Stacktrace:
[1] BigFloat(z::Complex{BigFloat})
@ Base .\complex.jl:37
[2] convert
@ .\number.jl:7 [inlined]
[3] setindex!
@ .\array.jl:839 [inlined]
[4] GSC(P::Matrix{ComplexF64}, p_P::Int64, stop_criteria::Float64, R_init::Int64, R_max::Int64, if_polish::Bool)
@ Main .\In[3]:44
[5] GSC(P::Matrix{ComplexF64}, p_P::Int64, stop_criteria::Float64, R_init::Int64, R_max::Int64)
@ Main .\In[3]:31
[6] top-level scope
@ In[5]:12
[7] eval
@ .\boot.jl:360 [inlined]
[8] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base .\loading.jl:1116

.

According to

[6] top-level scope
@ In[5]:12

I can understand that the error is from the 12th line of my main code, where I invoke a function named GSC. Then I am confused whether the error is at the 31st or 44th line in GSC according to

[4] GSC(P::Matrix{ComplexF64}, p_P::Int64, stop_criteria::Float64, R_init::Int64, R_max::Int64, if_polish::Bool)
@ Main .\In[3]:44
[5] GSC(P::Matrix{ComplexF64}, p_P::Int64, stop_criteria::Float64, R_init::Int64, R_max::Int64)
@ Main .\In[3]:31

The 31st line is the beginning of the body of the function GSC, and this line has nothing to do with BigFloat. So I think the 44th line is the location of the error.

My question is that what is the meaning of these following lines in the error information?

[7] eval
@ .\boot.jl:360 [inlined]
[8] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base .\loading.jl:1116

[5] GSC(P::Matrix{ComplexF64}, p_P::Int64, stop_criteria::Float64, R_init::Int64, R_max::Int64)
@ Main .\In[3]:31

GSC seems to recurse - line 31 is the definition of GSC with 5 arguments and line 44 is the definition with 6 arguments. The error seems to occur in the version with 6 arguments.

These are part of the julia loading/startup process.

1 Like