I use writedlm
to save my matrices in .txt
files and I found that occasionally the outputs are wrong, specifically the place of the decimal points. It happens for example 0.04
is saved as 0.4
. It only happens the first time I save the data, if I writedlm
the same matrix again then the results are correct. I wonder if anybody have seen this problem. It is not reproducible but happens quite often. I have Windows 10 and Julia 1.1.0.
Are you sure it is not writing 0.4e-1
to the file?
Also I’ve since been using CSV.write
and never had a problem. But writedlm
is so much faster and I’d prefer to use it.
I’m positive. The first time I spotted this was because I copyed and pasted the .txt
data into excel and I was comparing the two ODE results with slightly different parameters. I knew that the results should be different but not THAT different. Initially I thought there was something wrong with my code or maybe the result was really sensitive to the the parameter. But when I reran the code again, including writedlm
the difference became much smaller and within the range that I excepted. Then I noticed that if I start julia again and run the code with the same parameters the huge difference appeared again, then I knew it’s not a problem of my code but writedlm
. I then spotted that the decimal place in the first .txt
was wrong. Like I said that if I call writedlm
multiple times the 2nd, 3rd etc. .txt
are all correct. It only happens when I first call writedlm
in a new julia session.
I guess we need an example of how this happens (to reproduce it). It should be just a few lines of code.
Please make an MWE, and include versioninfo()
.
Even if it’s not minimal or 100% repeatable, please do post something that sometimes reproduces it. This would be a very serious bug.