From 32f6877288ea6b7eb1cae9a42fbe8e2c5dbb2f08 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 14 Dec 2017 23:04:39 -0800 Subject: altos/scheme: swap BIGINT and STRING types This lets BIGINT be a primitive type, allowing it to use all 32 bits for storage. This does make strings another byte longer, and also slightly harder to deal with. It's a trade off. Signed-off-by: Keith Packard --- src/scheme/ao_scheme_float.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/scheme/ao_scheme_float.c') diff --git a/src/scheme/ao_scheme_float.c b/src/scheme/ao_scheme_float.c index c026c6fb..b75289d7 100644 --- a/src/scheme/ao_scheme_float.c +++ b/src/scheme/ao_scheme_float.c @@ -69,10 +69,10 @@ ao_scheme_poly_number(ao_poly p) switch (ao_scheme_poly_base_type(p)) { case AO_SCHEME_INT: return ao_scheme_poly_int(p); + case AO_SCHEME_BIGINT: + return ao_scheme_poly_bigint(p)->value; case AO_SCHEME_OTHER: switch (ao_scheme_other_type(ao_scheme_poly_other(p))) { - case AO_SCHEME_BIGINT: - return ao_scheme_bigint_int(ao_scheme_poly_bigint(p)->value); case AO_SCHEME_FLOAT: return ao_scheme_poly_float(p)->value; } -- cgit v1.2.3