mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-07 13:16:36 +02:00
handling complex negation with a zero real part
This commit is contained in:
parent
386b798b35
commit
afacac6127
1 changed files with 5 additions and 1 deletions
6
sexp.c
6
sexp.c
|
@ -2851,7 +2851,11 @@ sexp sexp_read_raw (sexp ctx, sexp in) {
|
||||||
#endif
|
#endif
|
||||||
#if SEXP_USE_COMPLEX
|
#if SEXP_USE_COMPLEX
|
||||||
if (sexp_complexp(res)) {
|
if (sexp_complexp(res)) {
|
||||||
sexp_negate(sexp_complex_real(res));
|
if (sexp_complex_real(res) == SEXP_ZERO) {
|
||||||
|
sexp_negate(sexp_complex_imag(res));
|
||||||
|
} else {
|
||||||
|
sexp_negate(sexp_complex_real(res));
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
res = sexp_fx_mul(res, SEXP_NEG_ONE);
|
res = sexp_fx_mul(res, SEXP_NEG_ONE);
|
||||||
|
|
Loading…
Add table
Reference in a new issue