@@ -4,28 +4,26 @@ using Base.Math: nan_dom_err
4
4
5
5
struct AmosException <: Exception
6
6
id:: Int32
7
- msg:: String
8
-
9
- function AmosException (id:: Integer )
10
- msg = if id == 0
11
- " Normal return, computation complete."
12
- elseif id == 1
13
- " Input error"
14
- elseif id == 2
15
- " Overflow"
16
- elseif id == 3
17
- " Input argument magnitude large, less than half machine accuracy loss by argument reduction."
18
- elseif id == 4
19
- " Input argument magnitude too large, complete loss of accuracy by argument reduction."
20
- elseif id == 5
21
- " Algorithm termination condition not met."
22
- else
23
- throw (ArgumentError (" invalid AMOS error flag: $id " ))
24
- end
25
- new (id,msg)
7
+ end
8
+
9
+ function Base. showerror (io:: IO , ex:: AmosException )
10
+ print (io, " AmosException with id $(ex. id) : " )
11
+ if ex. id == 0
12
+ print (io, " normal return, computation complete." )
13
+ elseif ex. id == 1
14
+ print (io, " input error." )
15
+ elseif ex. id == 2
16
+ print (io, " overflow." )
17
+ elseif ex. id == 3
18
+ print (io, " input argument magnitude large, less than half machine accuracy loss by argument reduction." )
19
+ elseif ex. id == 4
20
+ print (io, " input argument magnitude too large, complete loss of accuracy by argument reduction." )
21
+ elseif ex. id == 5
22
+ print (io, " algorithm termination condition not met." )
23
+ else
24
+ print (io, " invalid error flag." )
26
25
end
27
26
end
28
- Base. showerror (io:: IO , err:: AmosException ) = print (io, " AmosException with id $(err. id) : $(err. msg) " )
29
27
30
28
# # Airy functions
31
29
function _airy (z:: Complex128 , id:: Int32 , kode:: Int32 )
0 commit comments