mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-28 22:10:29 +02:00
Read complex numbers where both parts are inexact decimals
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.
This commit is contained in:
parent
c7c36fcf40
commit
04f9bc774a
3 changed files with 22 additions and 7 deletions
|
@ -1365,7 +1365,14 @@
|
|||
("1@0" 1.0) ("1@+0" 1.0) ("1@-0" 1.0)
|
||||
("2+3i" ,(+ 2 (* 3 +i))) ("4-5i" ,(- 4 (* 5 +i)))
|
||||
("1+i" 1+1i) ("1-i" 1-1i) ("+1i" 0+1i) ("-1i" 0-1i)
|
||||
("+i" +1i) ("-i" -1i)))
|
||||
("+i" +1i) ("-i" -1i)
|
||||
("1.0+.1i" 1.0+0.1i)
|
||||
("1.0-.1i" 1.0-0.1i)
|
||||
(".1+.0i" 0.1)
|
||||
("1.+.0i" 1.0)
|
||||
(".1+.1i" 0.1+0.1i)
|
||||
("1e1+.1i" 10+0.1i)
|
||||
))
|
||||
#t)
|
||||
|
||||
(pass-if-exception "exponent too big"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue