diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-10-03 13:46:59 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-10-03 13:46:59 -0400 |
| commit | 35a19a2d1bb7605fa6ceb038b2b8afee760cd11c (patch) | |
| tree | de6991ee5941cfe81a1af04a47ca5d652abc5349 | |
| parent | 54e336e30f2112dc2cb0c1b85dd153667680e550 (diff) | |
Bugfix for Int*Num typechecking
| -rw-r--r-- | types.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -205,6 +205,11 @@ static PUREFUNC inline double type_max_magnitude(type_t *t) PUREFUNC precision_cmp_e compare_precision(type_t *a, type_t *b) { + if (is_int_type(a) && b->tag == NumType) + return NUM_PRECISION_LESS; + else if (a->tag == NumType && is_int_type(b)) + return NUM_PRECISION_MORE; + double a_min = type_min_magnitude(a), b_min = type_min_magnitude(b), a_max = type_max_magnitude(a), |
