From a274f836acb34d24ff447c715710c59fde570830 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 16 Jan 2026 20:33:43 -0500 Subject: Remove constructives --- src/stdlib/datatypes.h | 10 +--------- src/stdlib/reals.c | 11 ----------- 2 files changed, 1 insertion(+), 20 deletions(-) (limited to 'src/stdlib') diff --git a/src/stdlib/datatypes.h b/src/stdlib/datatypes.h index e8848e9a..8748e2be 100644 --- a/src/stdlib/datatypes.h +++ b/src/stdlib/datatypes.h @@ -46,8 +46,7 @@ typedef union { #define REAL_TAG_NONE 0ULL #define REAL_TAG_BIGINT 1ULL #define REAL_TAG_RATIONAL 2ULL -#define REAL_TAG_CONSTRUCTIVE 3ULL -#define REAL_TAG_SYMBOLIC 4ULL +#define REAL_TAG_SYMBOLIC 3ULL #define REAL_DOUBLE(r) \ (((union { \ @@ -57,18 +56,12 @@ typedef union { .d) #define REAL_BIGINT(r) ((Int_t *)((r).bits & ~0x7ULL)) #define REAL_RATIONAL(r) ((rational_t *)((r).bits & ~0x7ULL)) -#define REAL_CONSTRUCTIVE(r) ((constructive_t *)((r).bits & ~0x7ULL)) #define REAL_SYMBOLIC(r) ((symbolic_t *)((r).bits & ~0x7ULL)) typedef struct { __mpq_struct value; } rational_t; -typedef struct { - double (*compute)(void *ctx, int precision); - void *context; -} constructive_t; - typedef enum { SYM_INVALID, SYM_ADD, @@ -100,7 +93,6 @@ typedef union { uint64_t bits; struct symbolic *symbolic; rational_t *rational; - constructive_t *constructive; Int_t *bigint; } Real_t; diff --git a/src/stdlib/reals.c b/src/stdlib/reals.c index 27630c3d..bbe19d0d 100644 --- a/src/stdlib/reals.c +++ b/src/stdlib/reals.c @@ -131,10 +131,6 @@ double Real$as_float64(Real_t n, bool truncate) { rational_t *rational = REAL_RATIONAL(n); return mpq_get_d(&rational->value); } - case REAL_TAG_CONSTRUCTIVE: { - constructive_t *c = REAL_CONSTRUCTIVE(n); - return c->compute(c->context, 53); - } case REAL_TAG_SYMBOLIC: { symbolic_t *s = REAL_SYMBOLIC(n); double left = Real$as_float64(s->left, truncate); @@ -607,13 +603,6 @@ Text_t Real$as_text(const void *n, bool colorize, const TypeInfo_t *type) { : Texts(num_str, "/", den_str); return result; } - case REAL_TAG_CONSTRUCTIVE: { - constructive_t *c = REAL_CONSTRUCTIVE(num); - double approx = c->compute(c->context, 53); - char buf[64]; - snprintf(buf, sizeof(buf), "~%.17g", approx); - return colorize ? Texts(operator_color, "~", number_color, buf + 1, reset) : Text$from_str(buf); - } case REAL_TAG_SYMBOLIC: { symbolic_t *s = REAL_SYMBOLIC(num); const char *func = NULL; -- cgit v1.2.3