@@ -277,7 +277,7 @@ function convert{T, f, U, g}(::Type{FD{T, f}}, x::FD{U, g})
277277 if r == 0
278278 reinterpret (FD{T, f}, T (q))
279279 else
280- throw (InexactError ())
280+ throw (InexactError (:convert , FD{T, f}, x ))
281281 end
282282 end
283283end
@@ -299,7 +299,7 @@ function convert{TF <: BigFloat, T, f}(::Type{TF}, x::FD{T, f})::TF
299299end
300300
301301function convert {TI <: Integer, T, f} (:: Type{TI} , x:: FD{T, f} ):: TI
302- isinteger (x) || throw (InexactError ())
302+ isinteger (x) || throw (InexactError (:convert , TI, x ))
303303 div (x. i, coefficient (FD{T, f}))
304304end
305305
@@ -380,7 +380,7 @@ function parse{T, f}(::Type{FD{T, f}}, str::AbstractString, mode::RoundingMode=R
380380 end
381381
382382 # Parse exponent information
383- exp_index = findfirst (str, ' e' )
383+ exp_index = findfirst (equalto ( ' e' ), str )
384384 if exp_index > 0
385385 exp = parse (Int, str[(exp_index + 1 ): end ])
386386 sig_end = exp_index - 1
@@ -391,7 +391,7 @@ function parse{T, f}(::Type{FD{T, f}}, str::AbstractString, mode::RoundingMode=R
391391
392392 # Remove the decimal place from the string
393393 sign = T (first (str) == ' -' ? - 1 : 1 )
394- dec_index = findfirst (str, ' .' )
394+ dec_index = findfirst (equalto ( ' .' ), str )
395395 sig_start = sign < 0 ? 2 : 1
396396 if dec_index > 0
397397 int_str = str[sig_start: (dec_index - 1 )] * str[(dec_index + 1 ): sig_end]
@@ -412,7 +412,7 @@ function parse{T, f}(::Type{FD{T, f}}, str::AbstractString, mode::RoundingMode=R
412412 val = isempty (a) ? T (0 ) : sign * parse (T, a)
413413 if ! isempty (b) && any (collect (b[2 : end ]) .!= ' 0' )
414414 if mode == RoundThrows
415- throw (InexactError ())
415+ throw (InexactError (:parse , FD{T, f}, str ))
416416 elseif mode == RoundNearest
417417 val += sign * parse_round (T, b, mode)
418418 end
0 commit comments