you can decide what the edge case behavior you want, but this should do what you want in case of divisible ranges
julia> function map_range(range1, range2, val)
slope = length(range2)÷length(range1)
return range2[findfirst(==(val), range1) * slope]
end
map_range (generic function with 1 method)
julia> map_range(1:10, 1:100, 6)
60
julia> map_range(1:10, 1:100, 5)
50
julia> map_range(1:20, 1:100, 5)
25
julia> map_range(1:20, 1:100, 10)
50