Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

How to recover the parameters of a parametric type?

$
0
0

Is there any function that receives a parametric type as input and returns the parameters? For example, does the function below exist?

julia> get_parameters(Array{Float64, 2})
(Float64, 2)

In case get_parameters doesn’t exist, what are the alternatives?

I am asking this question because I am writing numerical algorithms with the fixed points of the FixedPointNumbers.jl package. When my function g() receives a Fixed{T,f} number, it needs to know the parameters T and f because they will determine the accuracy of my algorithm.

8 posts - 4 participants

Read full topic


Viewing all articles
Browse latest Browse all 2795

Trending Articles