Accuracy of floats saved with writedlm

question

#1

Following the discussion on More control over writedlm formatting I understood that the tool to save numeric matrices was wrtiedlm. I have a bunch of small Matrix{Float64}s (some times just 1x2, sometimes ~500x3, never more) that I need to save.
In DelimitedFiles’s documentation it’s mentioned that “the source can be a text file, stream or byte array”.
My question is: since I’m saving floats (and not integers), in order to increase accuracy or decrease format-dependent rounding, should I be saving my matrices as a “byte array” instead of a “text file”? And if so, how exactly? All I know of is:

writedlm("tmp.csv", rand(3))

I’ll just close with that after some experimentation, the numbers saved had a whopping 18 digits to them, so I think I’m good…


#2

If you are saving them for later use in Julia, consider using JLD2.jl


#3

No, it needs to be universal forever.


#4

When writing a .csv file with writedlm, a string representation of whatever you’re writing is saved instead of the binary representation. If the files are not meant to be read by humans, consider using a package with saving binary representation instead.


#5

You would not gain any accuracy. There shouldn’t be any rounding.


#6

This is very comforting, thank you. While

I feel writedlm is straightforward and fast. Seems like it’ll do the trick.