summaryrefslogtreecommitdiff
path: root/libstd/extremum.myr
diff options
context:
space:
mode:
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
- ;;
-}