Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将一个大浮点数“推”入一个元组。但得到以下错误:
# 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
错误消息提到convert()作为解决方案,但我不知道如何转换test().
convert()
test()
你不能推BigFloat入一个只接受的容器Tuples。你的容器必须接受BigFloats ,所以初始化它:
BigFloat
Tuples
store = BigFloat[]
另请注意,您可能刚刚写过:
store = test.(1:10)