commit 6cd3387d35d4b1c3559e29c40a4d5ff98ee50c90
parent 6d1c26bf5d24f491edc0d181e6bc6142975511e1
Author: Ed van Bruggen <edvb@uw.edu>
Date: Wed, 31 Oct 2018 13:19:55 -0700
Allow negative denominators again
Diffstat:
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/t/simple/frac.expect b/t/simple/frac.expect
@@ -6,4 +6,6 @@
1/2
1192/3619
-1/2
+-1/2
-2
+2
diff --git a/t/simple/frac.tsp b/t/simple/frac.tsp
@@ -6,4 +6,6 @@
4/8
02384/7238
-1/2
+1/-2
-6/3
+-6/-3
diff --git a/tisp.c b/tisp.c
@@ -427,7 +427,7 @@ read_num(Str str)
switch (*str->d) {
case '/':
str->d++;
- return mk_rat(sign * num, read_int(str));
+ return mk_rat(sign * num, read_sign(str) * read_int(str));
case '.':
s = emalloc(sizeof(str));
s->d = ++str->d;