We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3da9474 commit 06c8904Copy full SHA for 06c8904
src/FindFirstFunctions.jl
@@ -239,13 +239,13 @@ function (g::Guesser)(x)
239
else
240
i_0, i_f = firstindex(v), lastindex(v)
241
i_approx = f * (i_f - i_0) + i_0
242
- target_type = eltype(v)
243
- if i_approx <= typemin(target_type)
244
- firstindex(v) - 1
245
- elseif i >= typemax(target_type)
+ target_type = typeof(firstindex(v))
+ if i_approx >= typemax(target_type)
246
lastindex(v) + 1
+ elseif i_approx <= typemin(target_type)
+ firstindex(v) - 1
247
248
- round(target_type, i_appr)
+ round(target_type, i_approx)
249
end
250
251
0 commit comments