fixed parsing of complex numbers in the form <float>+/-<cmpn>i
where the <float> is in scientific notation.
This commit is contained in:
parent
a2e78a87d1
commit
8a277aa95a
|
@ -170,7 +170,11 @@
|
|||
(let ([mag (do-dec-sn/ex sn ex (* ac (expt 10 (+ exp1 (* exp2 exp-sign)))))])
|
||||
(next polar r mag ex))]
|
||||
[(digit r) => d
|
||||
(next exponent+digit r ex sn ac exp1 (+ (* exp2 r) d) exp-sign)])
|
||||
(next exponent+digit r ex sn ac exp1 (+ (* exp2 r) d) exp-sign)]
|
||||
[(#\i)
|
||||
(let ([n (do-dec-sn/ex sn ex
|
||||
(* ac (expt 10 (+ exp1 (* exp2 exp-sign)))))])
|
||||
(next im:done (make-rectangular 0 n)))])
|
||||
|
||||
(polar (r mag ex)
|
||||
[(digit r) => d
|
||||
|
|
|
@ -1 +1 @@
|
|||
1705
|
||||
1706
|
||||
|
|
|
@ -244,6 +244,9 @@
|
|||
(test "-0.i" (make-rectangular 0.0 -0.0))
|
||||
(test "#d#e-0.0f-0-.0s-0i" 0)
|
||||
|
||||
(test "+.234e4i" (make-rectangular 0 0.234e4))
|
||||
(test "+.234e-5i" (make-rectangular 0 0.234e-5))
|
||||
(test "+.234i" (make-rectangular 0 0.234))
|
||||
)
|
||||
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue