Creating strings of full precision arrays

I am creating a logging function and you need to create a string for the values ​​of an array of arrays at some intermediate points (both for printing and for saving to a file). I used the following to save arrays Ai , Bi , α and βi :

 resString = """ A₀ = $A0 A₁ = $A1 B₀ = $B0 B₁ = $B1 α = $α β₁ = $β1 β₂ = $β2 β₃ = $β3 β₄ = $β4 """ 

but interpolation does not give you full accuracy, and I need to save arrays with full accuracy. Is there an easy way to change this so that all lines display the full values ​​of the numbers?

+6
source share
1 answer

Is this what you want?

join(string.(A0), ",")

or

"[$(join(string.(A0), ","))]" if you need square brackets.

If you look here ( julia / base / strings / string.jl ), you can probably decide why!

+5
source

Source: https://habr.com/ru/post/1014085/


All Articles