If T = Float64, I observe that the values most often are set as some very small number, but is it possible for it to be a number such as “0.1”,“5” etc.?
The reason I ask is that I just found out that some code I had would produce unstable results if I used the undef initializer to pre-initialize the vector compared to using zeros(Float64,n).
By unstable I mean that the algorithm I am using would change results based on the initialized values of the undef vector.
Ah okay, thanks for the clarification. So it just takes any suitable amount of space available, without consideration of the previous data there, got it.
Using undef does not clear the space for you. You use undef when you are going to manually initialize the values anyways, so there is no point in trying to fill it with zeros.