pushing a big float inside a tuple Julia

73 Views Asked by At

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

enter image description here

The error message mentions convert() as a solution, but I am not sure how to convert test().

1

There are 1 best solutions below

0
Bogumił Kamiński On BEST ANSWER

You cannot push BigFloat into a container that accepts only Tuples. Your container has to accept BigFloats instead, so initialize it with:

store = BigFloat[]

Also note that you could have just written:

store = test.(1:10)