mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-07 05:06:37 +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
4
sexp.c
4
sexp.c
|
@ -2851,7 +2851,11 @@ sexp sexp_read_raw (sexp ctx, sexp in) {
|
|||
#endif
|
||||
#if SEXP_USE_COMPLEX
|
||||
if (sexp_complexp(res)) {
|
||||
if (sexp_complex_real(res) == SEXP_ZERO) {
|
||||
sexp_negate(sexp_complex_imag(res));
|
||||
} else {
|
||||
sexp_negate(sexp_complex_real(res));
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
res = sexp_fx_mul(res, SEXP_NEG_ONE);
|
||||
|
|
Loading…
Add table
Reference in a new issue