summary refs log tree commit diff stats
path: root/tests/manyloc/keineschweine/lib/math_helpers.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-04-13 21:55:02 +0200
committerAraq <rumpf_a@web.de>2013-04-13 21:55:02 +0200
commit75b508032b9da285f30d4ec7f2af4c63075b8611 (patch)
tree79476c0e8b7c70ee373bde21a2ea0a62d84520f8 /tests/manyloc/keineschweine/lib/math_helpers.nim
parent4f09794be9fb9b96728078712f01e990e0021929 (diff)
downloadNim-75b508032b9da285f30d4ec7f2af4c63075b8611.tar.gz
added manyloc test suite; --path now relative to project dir if not absolute
Diffstat (limited to 'tests/manyloc/keineschweine/lib/math_helpers.nim')
-rw-r--r--tests/manyloc/keineschweine/lib/math_helpers.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/manyloc/keineschweine/lib/math_helpers.nim b/tests/manyloc/keineschweine/lib/math_helpers.nim
new file mode 100644
index 000000000..8af56d1ed
--- /dev/null
+++ b/tests/manyloc/keineschweine/lib/math_helpers.nim
@@ -0,0 +1,10 @@
+import strutils, math
+
+proc degrees*(rad: float): float =
+  return rad * 180.0 / PI
+proc radians*(deg: float): float =
+  return deg * PI / 180.0
+
+## V not math, sue me
+proc ff*(f: float, precision = 2): string {.inline.} = 
+  return formatFloat(f, ffDecimal, precision)