TransformVariables.jl icon indicating copy to clipboard operation
TransformVariables.jl copied to clipboard

Initialize arrays with NaN for easier error detection

Open andreasnoack opened this issue 3 years ago • 1 comments

The NaNs will make it immediately obvious when some memory hasn't been properly set. I had a case where zero was the correct value so most often the random memory happened to have the correct value. Except on CI where it received memory that made the tests fail.

andreasnoack avatar Mar 30 '22 16:03 andreasnoack

Hmm, I was hoping we would catch errors with random tests, but I do see the rationale behind doing something like this.

I am wondering if this would work for float types that have no equivalent of NaN though. This is technically possibly in Julia for a custom <: AbstractFloat type.

tpapp avatar Mar 30 '22 18:03 tpapp