Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,21 @@
import strutils, math, sequtils
const
outFileName = "floatarr2file.txt"
proc sqrt*(x: int64): float {.importc: "sqrt", header: "<math.h>".}
const
xprecision = 3
yprecision = 5
var a: seq[int64] = @[int64(1), 2, 3, 100_000_000_000]
var b: seq[float] = @[sqrt(a[0]), sqrt(a[1]), sqrt(a[2]), sqrt(a[3])]
var c = zip(a,b)
var res: string = ""
for t in c:
res.add($formatFloat(float(t.a),ffDefault,xprecision) & "\t" & $formatFloat(t.b,ffDefault,yprecision) & "\n")
writeFile(outFileName,res)
var res2 = readFile(outFileName)
echo(res2)