I am trying to "push" a big float into a Tuple. But get following error:
# where test() is a function with big floats as values
store = Tuple{Any, Any}][]
for i in 1:10
push!(store, test(i))
end
store
The error message mentions convert()
as a solution, but I am not sure how to convert test()
.
You cannot push BigFloat
into a container that accepts only Tuples
. Your container has to accept BigFloat
s instead, so initialize it with:
store = BigFloat[]
Also note that you could have just written:
store = test.(1:10)