Function control flow

Integer is an abstract type in Julia (representing any integer type). Int is a concrete type.

Note that, while you do need to be sure that fields of data structures are concrete, you don’t need to declare b::Float64,bp::Float64 etcetera for function arguments. See e.g. this discussion. One of the strengths of Julia is that you can write type-generic code that is still fast, e.g. your function should be able to work with either single or double precision depending on what argument types were passed. (Data structures can be made type-generic without sacrificing performance by using parameterized types.)

1 Like