diff options
author | Andy Wingo <wingo@pobox.com> | 2011-09-29 18:02:28 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2011-09-29 18:02:28 +0200 |
commit | ca128245811fab5abcf02756cd7a322a3a40d192 (patch) | |
tree | 9138f716f1617f391d2b5f88802b2c6605dd79d2 /libguile/numbers.c | |
parent | 25f4a88032f51cecdf8b0147c8a2d0a4574972fa (diff) | |
parent | 014de9e25d87b7d3a13566aee4c271c1a11ea0b7 (diff) |
Merge remote-tracking branch 'origin/stable-2.0'
This was a pretty big merge involving a fair amount of porting,
especially to peval and its tests. I did not update psyntax-pp.scm,
that comes in the next commit.
Conflicts:
module/ice-9/boot-9.scm
module/ice-9/psyntax-pp.scm
module/language/ecmascript/compile-tree-il.scm
module/language/tree-il.scm
module/language/tree-il/analyze.scm
module/language/tree-il/inline.scm
test-suite/tests/tree-il.test
Diffstat (limited to 'libguile/numbers.c')
-rw-r--r-- | libguile/numbers.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libguile/numbers.c b/libguile/numbers.c index 235bbbb83..a278ed5b9 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -5436,6 +5436,9 @@ char_decimal_value (scm_t_uint32 c) return d; } +/* Parse the substring of MEM starting at *P_IDX for an unsigned integer + in base RADIX. Upon success, return the unsigned integer and update + *P_IDX and *P_EXACTNESS accordingly. Return #f on failure. */ static SCM mem2uinteger (SCM mem, unsigned int *p_idx, unsigned int radix, enum t_exactness *p_exactness) @@ -5707,7 +5710,16 @@ mem2ureal (SCM mem, unsigned int *p_idx, /* Cobble up the fractional part. We might want to set the NaN's mantissa from it. */ idx += 4; - mem2uinteger (mem, &idx, 10, &implicit_x); + if (!scm_is_eq (mem2uinteger (mem, &idx, 10, &implicit_x), SCM_INUM0)) + { +#if SCM_ENABLE_DEPRECATED == 1 + scm_c_issue_deprecation_warning + ("Non-zero suffixes to `+nan.' are deprecated. Use `+nan.0'."); +#else + return SCM_BOOL_F; +#endif + } + *p_idx = idx; return scm_nan (); } |