fraction = [sign] (num-den-spec | float-spec)
+
fraction = [sign] (num-den-spec ":" float-spec)
sign = "+" | "-"
num-den-spec = digit-seq "|" digit-seq
float-spec = dec-seq "." [dec-seq] "(" dec-seq ")"
@@ -998,55 +1008,55 @@ dev-expr -- Expressions calculator v1.10.0
>>> 1 | 2
-1|2>>> 1 : 2
+1:2
>>> 4|6 // Fractions are always reduced to their lowest terms
-2|3
>>> 4:6 // Fractions are always reduced to their lowest terms
+2:3
>>> 1|2 + 2|3
-7|6
>>> 1:2 + 2:3
+7:6
>>> 1|2 * 2|3
-1|3
>>> 1:2 * 2:3
+1:3
>>> 1|2 / 1|3
-3|2
>>> 1:2 / 1:3
+3:2
>>> 1|2 ./ 1|3 // Force decimal division
+
>>> 1:2 ./ 1:3 // Force decimal division
1.5
>>> -1|2
--1|2
>>> -1:2
+-1:2
>>> 1|-2 // Invalid sign specification
-Eval Error: [1:3] infix operator "|" requires two non-nil operands, got 1
>>> 1:-2 // Invalid sign specification
+Eval Error: [1:3] infix operator ":" requires two non-nil operands, got 1
>>> 1|(-2)
--1|2
>>> 1:(-2)
+-1:2
Fractions can be used together with integers and floats in expressions.
>>> 1|2 + 5
-11|2
>>> 1:2 + 5
+11:2
>>> 4 - 1|2
-7|2
>>> 4 - 1:2
+7:2
>>> 1.0 + 1|2
+
>>> 1.0 + 1:2
1.5