aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source
diff options
context:
space:
mode:
authorEduardo Julian2016-12-02 23:09:27 -0400
committerEduardo Julian2016-12-02 23:09:27 -0400
commita6b65a0595d079ffbb094b8d91f486f5365ce354 (patch)
tree96c05b4cd01d5ced6da6854c0e094c717495cd41 /stdlib/source
parent7d36004694c13cc290e107aaa859935c61b8bd94 (diff)
- Added Number implementation for Frac.
Diffstat (limited to 'stdlib/source')
-rw-r--r--stdlib/source/lux/data/number.lux13
1 files changed, 13 insertions, 0 deletions
diff --git a/stdlib/source/lux/data/number.lux b/stdlib/source/lux/data/number.lux
index 88cdc4eaf..8c3d08dbf 100644
--- a/stdlib/source/lux/data/number.lux
+++ b/stdlib/source/lux/data/number.lux
@@ -79,6 +79,19 @@
[Real Ord<Real> r.+ r.- r.* r./ r.% r.= r.< 0.0 1.0 -1.0]
)
+(struct: #export _ (Number Frac)
+ (def: ord Ord<Frac>)
+ (def: + f.+)
+ (def: - f.-)
+ (def: * f.*)
+ (def: / f./)
+ (def: % f.%)
+ (def: (negate x) (f.- x (_lux_proc ["frac" "max-value"] [])))
+ (def: abs id)
+ (def: (signum x)
+ (_lux_proc ["frac" "max-value"] []))
+ )
+
(do-template [<type> <ord> <succ> <pred>]
[(struct: #export _ (Enum <type>)
(def: ord <ord>)