diff options
author | Bdale Garbee <bdale@gag.com> | 2017-12-21 19:07:13 -0700 |
---|---|---|
committer | Bdale Garbee <bdale@gag.com> | 2017-12-21 19:07:13 -0700 |
commit | 456c27a7ed26e4edde02aa0a0b8ef4f46f1ea464 (patch) | |
tree | 7c259a612e315ac439c2d6ac87e08f6c67b68485 /src/scheme/ao_scheme_float.c | |
parent | fe2fe0f4b8382d7e0a5eceaeccced28ef004dab8 (diff) | |
parent | 16a9d8617b2d2092d166a85ada4349601afb0dce (diff) |
Merge branch 'branch-1.8' into debian
Diffstat (limited to 'src/scheme/ao_scheme_float.c')
-rw-r--r-- | src/scheme/ao_scheme_float.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/scheme/ao_scheme_float.c b/src/scheme/ao_scheme_float.c index 99249030..d8501548 100644 --- a/src/scheme/ao_scheme_float.c +++ b/src/scheme/ao_scheme_float.c @@ -15,6 +15,8 @@ #include "ao_scheme.h" #include <math.h> +#ifdef AO_SCHEME_FEATURE_FLOAT + static void float_mark(void *addr) { (void) addr; @@ -44,11 +46,12 @@ const struct ao_scheme_type ao_scheme_float_type = { #endif void -ao_scheme_float_write(ao_poly p) +ao_scheme_float_write(ao_poly p, bool write) { struct ao_scheme_float *f = ao_scheme_poly_float(p); float v = f->value; + (void) write; if (isnanf(v)) printf("+nan.0"); else if (isinff(v)) { @@ -67,10 +70,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; } @@ -150,3 +153,4 @@ ao_scheme_do_sqrt(struct ao_scheme_cons *cons) return ao_scheme_error(AO_SCHEME_INVALID, "%s: non-numeric", ao_scheme_poly_atom(_ao_scheme_atom_sqrt)->name); return ao_scheme_float_get(sqrtf(ao_scheme_poly_number(value))); } +#endif |