Anonymous user
Write float arrays to a text file: Difference between revisions
Updated to work with Nim 1.4: changed "t.a" to "t[0]" and "t.b" to "t[1]". Replaced tabulation with spaces. Other minor changes.
m (→{{header|Phix}}: added syntax colouring the hard way) |
(Updated to work with Nim 1.4: changed "t.a" to "t[0]" and "t.b" to "t[1]". Replaced tabulation with spaces. Other minor changes.) |
||
Line 1,039:
<lang nim>import strutils, math, sequtils
▲ outFileName = "floatarr2file.txt"
const
var
res.add formatFloat(t[0], ffDefault, Xprecision) & " " &
▲for t in c:
OutFileName.writeFile
var res2 = OutFileName.readFile(
echo
{{out}}
<pre>1.00
2.00
3.00
1.00e+11
=={{header|OCaml}}==
|