summaryrefslogtreecommitdiff
path: root/libstd/extremum.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-08-26 12:20:58 -0700
committerOri Bernstein <ori@eigenstate.org>2015-08-26 12:20:58 -0700
commit2bc852bda98762d3bc01548bf972e3f1b137fbfb (patch)
tree74831deed3c9057c5fe0cbb8790d220e855bc792 /libstd/extremum.myr
parent3de952510eb2a23350d24ed926f19c0cf72a12f2 (diff)
downloadmc-2bc852bda98762d3bc01548bf972e3f1b137fbfb.tar.gz
Move Myrddin libs to lib/ subdirectory.
Diffstat (limited to 'libstd/extremum.myr')
-rw-r--r--libstd/extremum.myr40
1 files changed, 0 insertions, 40 deletions
diff --git a/libstd/extremum.myr b/libstd/extremum.myr
deleted file mode 100644
index 9675915..0000000
--- a/libstd/extremum.myr
+++ /dev/null
@@ -1,40 +0,0 @@
-pkg std =
- generic min : (a : @a::numeric, b : @a::numeric -> @a::numeric)
- generic max : (a : @a::numeric, b : @a::numeric -> @a::numeric)
- generic clamp : (a : @a::numeric, min : @a::numeric, max : @a::numeric -> @a::numeric)
- generic abs : (a : @a::numeric -> @a::numeric)
-;;
-
-generic min = {a, b
- if a < b
- -> a
- else
- -> b
- ;;
-}
-
-generic max = {a, b
- if a > b
- -> a
- else
- -> b
- ;;
-}
-
-generic clamp = {a, min, max
- if a < min
- -> min
- elif a > max
- -> max
- else
- -> a
- ;;
-}
-
-generic abs = {a : @a::numeric
- if a < (0 castto(@a::numeric))
- -> -a
- else
- -> a
- ;;
-}