From ca931300e34e9dc8d52466147721e6dfbd82510e Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Thu, 17 Aug 2023 19:56:41 -0700 Subject: [PATCH] WIP --- runtime.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/runtime.c b/runtime.c index 2c6ea875..5bfd4f10 100644 --- a/runtime.c +++ b/runtime.c @@ -1854,7 +1854,15 @@ int FUNC_OP(void *data, object x, object y) { \ } else if (tx == double_tag && ty == bignum_tag) { \ result = (double_value(x)) OP mp_get_double(&bignum_value(y)); \ } else if (tx == complex_num_tag && ty == complex_num_tag) { \ - result = (complex_num_value(x)) == (complex_num_value(y)); \ + if (BN_CMP == CYC_BN_EQ) { \ + result = (complex_num_value(x)) == (complex_num_value(y)); \ + } else { \ + make_string(s, "Complex comparison operation not allowed"); \ + make_pair(c2, y, NULL); \ + make_pair(c1, x, &c2); \ + make_pair(c0, &s, &c1); \ + Cyc_rt_raise(data, &c0); \ + } \ } else if (tx == complex_num_tag && ty != complex_num_tag) { \ } else if (tx != complex_num_tag && ty == complex_num_tag) { \ } else { \ @@ -1932,7 +1940,16 @@ object FUNC_FAST_OP(void *data, object x, object y) { \ } else if (tx == double_tag && ty == bignum_tag) { \ return (double_value(x)) OP mp_get_double(&bignum_value(y)) ? boolean_t : boolean_f; \ } else if (tx == complex_num_tag && ty == complex_num_tag) { \ - return ((complex_num_value(x)) == (complex_num_value(y))) ? boolean_t : boolean_f; \ + if (BN_CMP == CYC_BN_EQ) { \ + return ((complex_num_value(x)) == (complex_num_value(y))) ? boolean_t : boolean_f; \ + } else { \ + make_string(s, "Complex comparison operation not allowed"); \ + make_pair(c2, y, NULL); \ + make_pair(c1, x, &c2); \ + make_pair(c0, &s, &c1); \ + Cyc_rt_raise(data, &c0); \ + return NULL; \ + } \ } else if (tx == complex_num_tag && ty != complex_num_tag) { \ return boolean_f; \ } else if (tx != complex_num_tag && ty == complex_num_tag) { \