* libguile/numbers.c (scm_product): Handle exact 0 differently. A
product containing an exact 0 now returns an exact 0 if and only if
the other arguments are all exact. An inexact zero is returned if and
only if the other arguments are all finite but not all exact. If an
infinite or NaN value is present, a NaN value is returned.
Previously, any product containing an exact 0 yielded an exact 0,
regardless of the other arguments.
A note on the rationale for (* 0 0.0) returning 0.0 and not exact 0:
The exactness propagation rules allow us to return an exact result in
the presence of inexact arguments only if the values of the inexact
arguments do not affect the result. In this case, the value of the
inexact argument _does_ affect the result, because an infinite or NaN
value causes the result to be a NaN.
A note on the rationale for (* 0 +inf.0) being a NaN and not exact 0:
The R6RS requires that (/ 0 0.0) return a NaN value, and that (/ 0.0)
return +inf.0. We would like (/ x y) to be the same as (* x (/ y)),
and in particular, for (/ 0 0.0) to be the same as (* 0 (/ 0.0)),
which reduces to (* 0 +inf.0). Therefore (* 0 +inf.0) should return
a NaN.
* test-suite/tests/numbers.test: Add many multiplication tests.
* NEWS: Add NEWS entry.
* libguile/numbers.c (scm_rationalize): Fix bugs. Previously, it
returned exact integers unmodified, although that was incorrect if
the epsilon was at least 1 or inexact, e.g. (rationalize 4 1) should
return 3 per R5RS and R6RS, but previously it returned 4. Also
handle cases involving infinities and NaNs properly, per R6RS.
* test-suite/tests/numbers.test: Add test cases for `rationalize'.
* NEWS: Add NEWS entry
* libguile/numbers.c (scm_integer_expt): No longer require that the
first argument be a number, in order to improve extensibility. This
allows us to efficiently raise arbitrary objects to an integer power
as long as we can multiply those objects. For example, this allows us
to efficiently exponentiate matrices if we define only multiplication
methods for matrices. Note also that scm_expt calls this procedure
whenever the exponent is an integer, regardless of the type of the
first argument. Also rearrange the order in which we test special
cases.
* test-suite/tests/numbers.test (expt, integer-expt): Comment out tests
that required `(expt #t 0)' and `(integer-expt #t 0)' to throw
exceptions. Add tests for (expt #t 2) and `(integer-expt #t 2)
instead.
* NEWS: Add NEWS entry
* libguile/numbers.c (euclidean_quo_rem): Rename to euclidean_divide.
(centered_quo_rem): Rename to {euclidean,centered}_divide.
* libguile/numbers.h: Rename euclidean_quo_rem to euclidean_divide and
centered_quo_rem to centered_divide.
* doc/ref/api-data.texi: Rename euclidean_quo_rem to euclidean_divide and
centered_quo_rem to centered_divide.
* libguile/numbers.c (scm_quotient, scm_remainder, scm_modulo,
scm_zero_p, scm_positive_p, scm_negative_p, scm_real_part,
scm_imag_part, scm_numerator, scm_denominator, scm_magnitude,
scm_angle, scm_exact_to_inexact): Change from SCM_GPROC to
SCM_PRIMITIVE_GENERIC. As a side effect, all of these procedures now
have documentation strings.
(scm_exact_p, scm_inexact_p, scm_odd_p, scm_even_p, scm_finite_p,
scm_inf_p, scm_nan_p, scm_expt, scm_inexact_to_exact, scm_log,
scm_log10, scm_exp, scm_sqrt): Change from SCM_DEFINE to
SCM_PRIMITIVE_GENERIC, and make sure the code allows these functions
to be extended in practice.
(scm_real_part, scm_imag_part, scm_numerator, scm_denominator,
scm_inexact_to_exact): Simplify type dispatch code.
(scm_sqrt): Rename formal argument from x to z, since complex numbers
are supported.
(scm_abs): Fix empty FUNC_NAME.
* libguile/numbers.h (scm_finite_p): Add missing prototype.
(scm_inf_p, scm_nan_p): Rename formal parameter from n to x, since
the domain is the real numbers.
* test-suite/tests/numbers.test: Test for documentation strings. Change
from `expect-fail' to `pass-if' for several of these, and add tests
for others. Also add other tests for `real-part' and `imag-part',
which previously had none.
* libguile/numbers.c (scm_euclidean_quo_and_rem, scm_euclidean_quotient,
scm_euclidean_remainder, scm_centered_quo_and_rem,
scm_centered_quotient, scm_centered_remainder): New extensible
procedures `euclidean/', `euclidean-quotient', `euclidean-remainder',
`centered/', `centered-quotient', `centered-remainder'.
* libguile/numbers.h: Add function prototypes.
* module/rnrs/base.scm: Remove incorrect stub implementations of `div',
`mod', `div-and-mod', `div0', `mod0', and `div0-and-mod0'. Instead do
renaming imports of `euclidean-quotient', `euclidean-remainder',
`euclidean/', `centered-quotient', `centered-remainder', and
`centered/', which are equivalent to the R6RS operators.
* module/rnrs/arithmetic/fixnums.scm (fxdiv, fxmod, fxdiv-and-mod,
fxdiv0, fxmod0, fxdiv0-and-mod0): Remove redundant checks for division
by zero and unnecessary complexity.
(fx+/carry): Remove unneeded calls to `inexact->exact'.
* module/rnrs/arithmetic/flonums.scm (fldiv, flmod, fldiv-and-mod,
fldiv0, flmod0, fldiv0-and-mod0): Remove redundant checks for division
by zero and unnecessary complexity. Remove unneeded calls to
`inexact->exact' and `exact->inexact'
* test-suite/tests/numbers.test: (test-eqv?): New internal predicate for
comparing numerical outputs with expected values.
Add extensive test code for `euclidean/', `euclidean-quotient',
`euclidean-remainder', `centered/', `centered-quotient',
`centered-remainder'.
* test-suite/tests/r6rs-arithmetic-fixnums.test: Fix some broken test
cases, and remove `unresolved' test markers for `fxdiv', `fxmod',
`fxdiv-and-mod', `fxdiv0', `fxmod0', and `fxdiv0-and-mod0'.
* test-suite/tests/r6rs-arithmetic-flonums.test: Remove `unresolved'
test markers for `fldiv', `flmod', `fldiv-and-mod', `fldiv0',
`flmod0', and `fldiv0-and-mod0'.
* doc/ref/api-data.texi (Arithmetic): Document `euclidean/',
`euclidean-quotient', `euclidean-remainder', `centered/',
`centered-quotient', and `centered-remainder'.
(Operations on Integer Values): Add cross-references to `euclidean/'
et al, from `quotient', `remainder', and `modulo'.
* doc/ref/r6rs.texi (rnrs base): Improve documentation for `div', `mod',
`div-and-mod', `div0', `mod0', and `div0-and-mod0'. Add
cross-references to `euclidean/' et al.
* NEWS: Add NEWS entry.
* libguile/numbers.c (scm_abs, scm_quotient, scm_remainder, scm_modulo):
Add SCM_LIKELY and SCM_UNLIKELY in several places for optimization.
(scm_remainder): Add comment about C99 "%" semantics.
Strip away a redundant set of braces.
* libguile/numbers.c (scm_rational_p): Return #f for infinities and
NaNs, per R6RS. Previously it returned #t for real infinities
and NaNs. They are still considered real by scm_real `real?'
however, per R6RS. Also simplify the code.
(scm_real_p): New implementation to reflect the fact that the
rationals and reals are no longer the same set. Previously it just
called scm_rational_p.
(scm_integer_p): Simplify the code.
* test-suite/tests/numbers.test: Add test cases for `rational?'
and `real?' applied to infinities and NaNs.
* doc/ref/api-data.texi (Real and Rational Numbers): Update docs to
reflect the fact that infinities and NaNs are no longer rational, and
that `real?' no longer implies `rational?'. Improve discussion of
infinities and NaNs.
* NEWS: Add NEWS entries, and combine with an earlier entry about
infinities no longer being integers.
Change `equal?' to work like `eqv?' for numbers.
Previously they worked differently in some cases, e.g.
when comparing signed zeroes or NaNs. For example,
(equal? 0.0 -0.0) returned #t but (eqv? 0.0 -0.0)
returned #f, and (equal? +nan.0 +nan.0) returned #f
but (eqv? +nan.0 +nan.0) returned #t.
* libguile/numbers.c (scm_real_equalp, scm_bigequal,
scm_complex_equalp, scm_i_fraction_equalp): Move to eq.c.
* libguile/eq.c (scm_real_equalp): Compare flonums using
real_eqv instead of ==, so that NaNs are now considered
equal, and to distinguish signed zeroes.
(scm_complex_equalp): Compare real and imaginary
components using real_eqv instead of ==, so that NaNs are
now considered equal, and to distinguish signed zeroes.
(scm_bigequal): Use scm_i_bigcmp instead of duplicating it.
(real_eqv): Test for NaNs using isnan(x) instead of
(x != x), and use SCM_UNLIKELY for optimization.
(scm_eqv_p): Use scm_bigequal, scm_real_equalp,
scm_complex_equalp, and scm_i_fraction_equalp to compare
numbers, instead of inline code. Those predicates now do
what scm_eqv_p formerly did internally. Replace if
statements with switch statements, as is done in
scm_equal_p. Remove useless code to check equality of
fractions with different SCM_CELL_TYPEs; this was for a
tentative "lazy reduction bit" which was never developed.
(scm_eqv_p, scm_equal_p): Remove useless code to check
equality between inexact reals and non-real complex numbers
with zero imaginary part. Such numbers do not exist,
because the current code is careful to never create them.
* test-suite/tests/numbers.test: Add test cases for
`eqv?' and `equal?'. Change existing test case for
`(equal? +nan.0 +nan.0)' to expect #t instead of #f.
* NEWS: Add NEWS entries.
* libguile/numbers.c (scm_difference, scm_product):
Fix bugs when negating SCM_MOST_POSITIVE_FIXNUM+1,
aka -SCM_MOST_NEGATIVE_FIXNUM. Previously, these cases
failed to normalize the result to a fixnum, causing
`=', `eqv?' and `equal?' to fail, e.g.:
(= most-negative-fixnum (- 0 (- most-negative-fixnum)))
(= most-negative-fixnum (* -1 (- most-negative-fixnum)))
(= most-negative-fixnum (* (- most-negative-fixnum) -1))
* test-suite/test/numbers.test: Add test cases to detect
bugs when negating SCM_MOST_POSITIVE_FIXNUM+1 and
SCM_MOST_NEGATIVE_FIXNUM by various methods.
* libguile/numbers.c (scm_inf_p, scm_finite_p, scm_nan_p): The domain of
these functions is the real numbers. Error on other input.
* doc/ref/api-data.texi (Reals and Rationals): Update the documentation
accordingly.
* test-suite/tests/numbers.test ("finite?", "inf?"): Update tests.
* libguile/numbers.c (scm_exact_p): Optimize by making use of the
SCM_INEXACTP macro.
(scm_inexact_p): Move it next to scm_exact_p, and add else's.
* test-suite/tests/numbers.test: Add test cases for `exact?'
and `inexact?' applied to infinities and NaNs.
* libguile/numbers.c (scm_finite_p): Add new predicate `finite?' from
R6RS to guile core, which returns #t if and only if its argument is
neither infinite nor a NaN. Note that this is not the same as (not
(inf? x)) or (not (infinite? x)), since NaNs are neither finite nor
infinite.
* test-suite/tests/numbers.test: Add test cases for `finite?'.
* module/rnrs/base.scm: Import `inf?' as `infinite?' instead of
reimplementing it. Previously, the R6RS implementation of
`infinite?' did not detect non-real complex infinities, nor did it
throw exceptions for non-numbers. (Note that NaNs _are_ considered
numbers by scheme, despite their name).
Import `finite?' instead of reimplementing it. Previously, the R6RS
implementation of `finite?' returned #t for both NaNs and non-real
complex infinities, in violation of R6RS.
* NEWS: Add NEWS entries, and reorganize existing numerics-related
entries together under one subheading.
* doc/ref/api-data.texi (Real and Rational Numbers): Add docs for
`finite?' and scm_finite_p.
* libguile/numbers.h: Add SCM_INUM1, a name for the fixnum 1. This is
analogous to SCM_INUM0, a name for 0, which already existed.
* libguile/numbers.c: Change occurrences of SCM_I_MAKINUM (0) and
SCM_I_MAKINUM (1) to SCM_INUM0 and SCM_INUM1, respectively.
* libguile/numbers.c (scm_is_integer): Infinities are not integers, per
the R6RS.
(scm_even_p, scm_odd_p): Passing an infinity to even? or odd? is an
error.
* test-suite/tests/numbers.test ("integer?"): Adapt test.
("expt"): Add tests for +inf.0 and -inf.0 exponents.
* NEWS: Add NEWS entries.
* libguile/numbers.c (scm_expt): Fix bug that caused expt to throw an
exception whenever the base was exact and the exponent was an
inexact integer, e.g. (expt 5 6.0).
(scm_expt): Fix bug that caused expt to introduce spurious imaginary
parts in the result when the base was an inexact negative real and
the exponent was an integer, e.g. (expt -1.0 2)
(scm_integer_expt, scm_expt): Change behavior of (integer-expt 0 -1),
and therefore also (expt 0 -1), to return NaN, per R6RS (actually,
R6RS says we should throw an exception or return an "unspecified
number object", but for now we use NaN). Formerly we returned 0, per
R5RS. R5RS claims that 0^x=0 for all non-zero x, but that's
mathematically incorrect, and probably an oversight.
(scm_integer_expt): Consistently throw a wrong-argument-type exception
when the exponent is inexact. Formerly, it didn't always check this
if the base was 0, 1, or -1.
* test-suite/tests/numbers.test ("integer-expt", "expt"): Add tests.
* libguile/bytevectors.c:
* libguile/goops.c:
* libguile/instructions.c:
* libguile/numbers.c:
* libguile/random.c:
* libguile/read.c:
* libguile/vm-i-scheme.c: Fix a number of assumptions that a long could
hold an inum. This is not the case on platforms whose void* is larger
than their long.
* libguile/numbers.c (scm_i_inum2big): New helper, only implemented for
sizeof(void*) == sizeof(long); produces a compile error on other
platforms. Basically gmp doesn't have a nice interface for converting
between mpz values and intmax_t.
* libguile/numbers.c (scm_iuint2str): Add an assertion on the domain of
the radix. Use the number_chars table to write the string, instead of
doing strange math. Same effect, though.
(mem2uinteger, char_decimal_value): Change logic to allow all ascii
alphabetic chars as decimals, not just a-f. Thanks to Nils Gey for the
report.
* test-suite/tests/numbers.test ("number->string"): Add some tests.
* libguile/numbers.h (SCM_COMPLEX_MEM): Remove.
(SCM_COMPLEX_REAL): Change to just fetch the `real' field of the
pointed-to `scm_t_complex'.
(SCM_COMPLEX_IMAG): Likewise.
(scm_t_complex)[type, pad]: New fields.
* libguile/numbers.c (scm_c_make_rectangular): Allocate the whole
complex contiguously, with `scm_gc_malloc_pointerless'.
The `mpz_t' associated with a bignum would never be freed, so an
expression like `(while #t (expt 2 5000))' would quickly lead to memory
exhaustion.
* libguile/numbers.c (finalize_bignum): New function.
(make_bignum): Register it as a finalizer for P.
* libguile/numbers.c (make_bignum): New function.
(scm_i_mkbig, scm_i_long2big, scm_i_ulong2big, scm_i_clonebig,
scm_i_dbl2big, scm_i_mpz2num): Use it.
* libguile/numbers.c (scm_log10): Check whether `HAVE_COMPLEX_DOUBLE'
and `HAVE_CLOG10' are defined instead of checking whether they are
non-zero.
(scm_sqrt): Likewise for `HAVE_COMPLEX_DOUBLE' and
`HAVE_USABLE_CSQRT'.
This updates Gnulib to v0.0-4219-g84cdd8b.
* m4/gnulib-cache.m4: Add `isinf' and `isnan'.
* configure.ac: Remove checks for `floatingpoint.h', `ieeefp.h', and
`nan.h'.
* libguile/gen-scmconfig.c (main): Remove definitions of
`SCM_HAVE_FLOATINGPOINT_H', `SCM_HAVE_IEEEFP_H', and
`SCM_HAVE_NAN_H'.
* libguile/numbers.c (isnan)[SCO && !HAVE_ISNAN]: Remove.
(isinf)[SCO && !HAVE_ISINF]: Remove.
(xisinf, xisnan): Remove. Change callers to use `isinf' and `isnan'.
(guile_ieee_init): Remove the `defined HAVE_ISINF' and `define
HAVE_ISNAN' conditions.
* libguile/numbers.h: Remove code conditional on
`SCM_HAVE_FLOATINGPOINT_H', `SCM_HAVE_IEEEFP_H', or `SCM_HAVE_NAN_H'.
* libguile/Makefile.am:
* libguile/discouraged.c: Remove discouraged.c.
* libguile/deprecated.c:
* libguile/deprecated.h:
* libguile/discouraged.h: All functions and declarations moved from
discouraged.[ch] to deprecated.[ch], adding deprecation warnings.
* libguile/init.c: Remove discouraged init.
* libguile/numbers.c (scm_num2float, scm_num2double): Deprecate.
* test-suite/standalone/test-num2integral.c: Port to modern API.
* libguile/numbers.c (scm_integer_expt): Validate the first arg as a
number.
(scm_expt): Delegate to scm_integer_expt iff x is exact. Fixes
fractions.test, which I broke recently
* test-suite/tests/numbers.test ("integer-expt"): Add test for
(integer-expt #t 0).
* libguile/root.h
* libguile/root.c (scm_sys_protects): It used to be that for some reason
we'd define a special array of "protected" values. This was a little
silly, always, but with the BDW GC it's completely unnecessary. Also
many of these variables were unused, and none of them were good API.
So remove this array, and either eliminate, make static, or make
internal the various values.
* libguile/snarf.h: No need to generate calls to scm_permanent_object.
* guile-readline/readline.c (scm_init_readline): No need to call
scm_permanent_object.
* libguile/array-map.c (ramap, rafe): Remove the dubious nullvect
optimizations.
* libguile/async.c (scm_init_async): No need to init scm_asyncs, it is
no more.
* libguile/eval.c (scm_init_eval): No need to init scm_listofnull, it is
no more.
* libguile/gc.c: Make scm_protects a static var.
(scm_storage_prehistory): Change the sanity check to use the address
of protects.
(scm_init_gc_protect_object): No need to clear the scm_sys_protects,
as it is no more.
* libguile/keywords.c: Make the keyword obarray a static var.
* libguile/numbers.c: Make flo0 a static var.
* libguile/objprop.c: Make object_whash a static var.
* libguile/properties.c: Make properties_whash a static var.
* libguile/srcprop.h:
* libguile/srcprop.c: Make scm_source_whash a global with internal
linkage.
* libguile/strings.h:
* libguile/strings.c: Make scm_nullstr a global with internal linkage.
* libguile/vectors.c (scm_init_vectors): No need to init scm_nullvect,
it's unused.
* libguile/tags.h: Remove rpsubrs (I chose to interpret the terse name
as "recursive predicate subrs"). Just use gsubrs with rest arguments,
or do a fold yourself.
* libguile/array-map.c (scm_i_array_equal_p): Do the comparison in
order, why not.
* libguile/chars.c:
* libguile/eq.c:
* libguile/numbers.c:
* libguile/strorder.c: Add 0,2,1 gsubr wrappers for rpsubrs like eq?, <,
etc.
* libguile/goops.c (scm_class_of)
* libguile/procprop.c (scm_i_procedure_arity)
* libguile/procs.c (scm_thunk_p)
* libguile/vm.c (apply_foreign): Remove rpsubr cases.
* test-suite/tests/numbers.test ("=", "<"): Turn a couple xfails into
passes.
* libguile/numbers.h:
* libguile/numbers.c (scm_i_sum): Rework so that scm_sum is just a
normal function. Its generic is actually provided by scm_i_sum, a
gsubr with rest args. In that way, + is no longer an asubr.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_asinh, scm_acosh, scm_atanh): Deprecate
these stand-ins for the C99 asinh, acosh, and atanh functions. Guile
is not gnulib.
(scm_sys_atan2): Deprecate as well, in favor of scm_atan.
* libguile/numbers.h:
* libguile/numbers.c (scm_sin, scm_cos, scm_tan)
(scm_sinh, scm_cosh, scm_tanh)
(scm_asin, scm_acos, scm_atan)
(scm_sys_asinh, scm_sys_acosh, scm_sys_atanh): New functions,
replacing the combination of dsubrs and boot-9 wrappers with C subrs
that handle complex values. The latter three have _sys_ in their names
due to the name conflict with the deprecated scm_asinh et al.
Remove the $abs, $sin etc "dsubrs".
* module/ice-9/boot-9.scm: Remove transcendental functions, as this all
happens in C now.
* module/ice-9/deprecated.scm: Add aliases for $sin et al.
* test-suite/tests/ramap.test ("array-map!"): Adjust "dsubr" tests to
use sqrt, not $sqrt. They don't actually test dsubrs now. In the
two-source test, I'm pretty sure the dsubr array-map! should have been
failing, as indeed it does now; I've changed the test case to expect
the failure. I'd still like to know why it was succeeding before.
* libguile/numbers.h:
* libguile/numbers.c (scm_expt): Rename from scm_sys_expt, and handle
the complex cases as well.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_sys_expt): Add a deprecated shim.
* module/ice-9/boot-9.scm (expt): Remove definition, scm_expt does all
we need.
The intent is to allow compilation with `-Wundef', which in turn should
make it easier to catch erroneous uses of nonexistent macros.
* libguile/__scm.h: Don't assume `BUILDING_LIBGUILE' is defined.
* libguile/conv-uinteger.i.c (SCM_TO_TYPE_PROTO): Remove unneeded CPP
conditional on `TYPE_MIN == 0'.
* libguile/fports.c: Check for the definition of `HAVE_CHSIZE' and
`HAVE_FTRUNCATE', not for their value.
* libguile/ports.c: Likewise.
* libguile/numbers.c (guile_ieee_init): Likewise with `HAVE_DINFINITY'
and `HAVE_DQNAN'.
* test-suite/standalone/test-conversion.c (ieee_init): Likewise.
* libguile/strings.c: Likewise with `SCM_STRING_LENGTH_HISTOGRAM'.
* libguile/strings.h: Likewise.
* libguile/tags.h: Likewise with `HAVE_INTTYPES_H' and `HAVE_STDINT_H'.
* libguile/threads.c: Likewise with `HAVE_PTHREAD_GET_STACKADDR_NP'.
* libguile/vm-engine.c (VM_NAME): Likewise with `VM_CHECK_IP'.
* libguile/gen-scmconfig.c (main): Use "#ifdef HAVE_", not "#if HAVE_".
* libguile/socket.c (scm_setsockopt): Likewise.
* libguile/numbers.c (scm_i_print_fraction): use string accessors
(XDIGIT2UINT): use libunistring function
(mem2uinteger, mem2integer, mem2decimal_from_point, mem2ureal)
(mem2complex): take scheme string instead of c string; use accessors
(scm_i_string_to_number): new function
(scm_c_locale_string_to_number): use scm_i_string_to_number
* libguile/numbers.h: declaration for scm_i_string_to_number
* libguile/strings.c (scm_i_string_strcmp): new function
* libguile/strings.h: declaration for scm_i_string_strcmp
* libguile/numbers.c (mem2decimal_from_point, mem2ureal, mem2complex):
Fix a number of cases where, for invalid numbers, we could read past
the end of the buffer. This happened in e.g. "1.0+", "1/" and "1.0f".
But I couldn't figure out how to test for these, given that the
behavior depended on the contents of uninitialized memory in the
reader buffer. We'll just have to be happy with this.
Thanks to Kjetil S. Matheussen for the report.
This adds the 32-bit standalone characters. Strings are still
8-bit. Characters larger than 8-bit can only be entered or
displayed in octal format at this point. At this point, the
terminal's display encoding is expected to be Latin-1.
* module/language/assembly/compile-bytecode.scm (write-bytecode):
add 32-bit char
* module/language/assembly.scm (object->assembly): add 32-bit char
(assembly->object): add 32-bit char
* libguile/vm-i-system.c (make-char32): new op
* libguile/print.c (iprin1): print 32-bit char
* libguile/numbers.h: add type scm_t_wchar
* libguile/numbers.c: add type scm_t_wchar
* libguile/chars.h: new type scm_t_wchar
(SCM_CODEPOINT_MAX): new
(SCM_IS_UNICODE_CHAR): new
(SCM_MAKE_CHAR): operate on 32-bit char
* libguile/chars.c: comparison operators now use Unicode
codepoints
(scm_c_upcase): now receives and returns scm_t_wchar
(scm_c_downcase): now receives and returns scm_t_wchar
Thanks to Bill Schottstaedt for reporting this problem!
* libguile/numbers.c (mem2ureal): Don't be misled by *p_exactness
being INEXACT on entry (as is possible when reading a complex
number): use local exactness variable x which starts as EXACT.
Call mem2decimal_from_point () with &x instead of p_exactness.
* test-suite/tests/numbers.test ("string->number"): Add complex number
tests suggested by Bill.