1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-27 21:40:34 +02:00
guile/test-suite/tests
Mark H Weaver c721848287 Support non-real complex numbers with inexact zero imaginary part
Add the ability to represent non-real complex numbers whose imaginary
part is an _inexact_ zero (0.0 or -0.0), per R6RS.  Previously, such
numbers were immediately changed into inexact reals.

* libguile/numbers.c: Remove from the list of `General assumptions' in
  numbers.c that objects satisfying SCM_COMPLEXP() have a non-zero
  complex component.  This is no longer true.  Also add a warning
  about another unrelated assumption that is not entirely correct
  (that floor(r) == r implies that mpz_set_d will DTRT; it won't
  if r is infinite).

  (icmplx2str): Always print the imaginary part, even if it is zero.
  Also handle a negative zero imaginary part more gracefully.  It
  now prints 0.0-0.0i, where previously it would print 0.0+-0.0i.

  (mem2ureal): Replace scm_from_double (0.0) with flo0.

  (scm_c_make_rectangular): Always create non-real complex numbers.
  Previously it would create inexact reals if the specified imaginary
  part was zero.

  (scm_make_rectangular): If the imaginary part is an _exact_ 0, return
  the real part unchanged (possibly exact), otherwise return a non-real
  complex number (possibly with an inexact zero imaginary part).
  Previously, it would return an inexact real number whenever the
  imaginary part was any kind of zero.

  (scm_make_polar): If the magnitude is an exact 0, return an exact 0.
  If the angle is an exact 0, return the magnitude unchanged (possibly
  exact).  Otherwise return a non-real complex number (possibly with an
  inexact zero imaginary part).  Previously, it would return a real
  number whenever the imaginary part was any kind of zero.

  (scm_imag_part): Return an exact 0 if applied to a real number.
  Previously it would return an inexact zero if applied to an inexact
  real number.

  (scm_inexact_to_exact): Accept complex numbers with inexact zero
  imaginary part.  In that case, simply use the real part and ignore the
  imaginary part.  Essentially we coerce the inexact zero imaginary part
  to an exact 0.

* test-suite/tests/numbers.test: Add many test cases, and modify
  existing tests as needed to reflect these changes.  Also add a new
  internal predicate: `almost-real-nan?' which tests for a non-real
  complex number with zero imaginary part whose real part is a NaN.

* doc/ref/api-data.texi (Complex Numbers): Update description of complex
  numbers to reflect these changes: non-real complex numbers in Guile
  need not have non-zero imaginary part.  Also, each part of a complex
  number may be any inexact real, not just rationals as was previously
  stated.  Explicitly mention that each part may be an infinity, a NaN,
  or a signed zero.

  (Complex Number Operations): Change the formal parameter names of
  `make-polar' from `x' and `y' to `mag' and `ang'.

* NEWS: Add news entries.
2011-02-02 21:34:01 +01:00
..
00-initial-env.test Add optimized tagged integer addition/subtractions for x86_64. 2010-11-19 13:34:43 +01:00
alist.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
and-let-star.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
arbiters.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
arrays.test add docs and tests for array->list 2010-04-07 21:04:37 +02:00
asm-to-bytecode.test rename (rnrs bytevector) to (rnrs bytevectors) 2010-06-01 13:26:11 +02:00
bit-operations.test fix bug in ash opcode 2010-03-31 22:29:29 +02:00
bitvectors.test bitvector work 2010-08-29 20:48:32 -07:00
brainfuck.test fix brainfuck for new tree-il, and add tests 2009-10-23 15:10:25 +02:00
bytevectors.test Move with-test-prefix/c&e' to (test-suite lib)'. 2010-11-19 13:34:43 +01:00
c-api.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
chars.test Re-introduce pretty-printing of combining characters. 2010-09-15 01:02:54 +02:00
common-list.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
compiler.test add call-with-vm; remove thread-vm bits; remove vm-apply; engines settable. 2010-09-27 21:12:29 +02:00
continuations.test remove debug frames 2009-12-03 11:03:39 +01:00
control.test add call-with-vm; remove thread-vm bits; remove vm-apply; engines settable. 2010-09-27 21:12:29 +02:00
coverage.test Fix coverage analysis of procedures called from C. 2010-09-24 15:39:47 +02:00
curried-definitions.test fix curried definitions for value defines 2010-04-08 21:01:52 +02:00
ecmascript.test Add ECMAScript parser tests. 2011-01-26 23:47:31 +01:00
elisp-compiler.test lexical function binding for elisp 2010-12-07 13:21:03 +01:00
elisp-reader.test use correct names for quasiquotation operators 2010-12-07 13:21:02 +01:00
elisp.test elisp.test cleanups 2010-04-09 22:33:46 +02:00
encoding-escapes.test Change `scm_encoding_error' to pass the port and faulty character. 2011-02-02 18:06:29 +01:00
encoding-iso88591.test Re-introduce pretty-printing of combining characters. 2010-09-15 01:02:54 +02:00
encoding-iso88597.test Use encoding-error' instead of misc-error' for string encoding errors. 2010-01-07 11:10:35 +01:00
encoding-utf8.test Re-introduce pretty-printing of combining characters. 2010-09-15 01:02:54 +02:00
eval.test add call-with-vm; remove thread-vm bits; remove vm-apply; engines settable. 2010-09-27 21:12:29 +02:00
exceptions.test deprecate lazy-catch 2010-02-26 11:56:02 +01:00
filesys.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
fluids.test fix unbound fluid tests 2010-12-17 13:53:29 +01:00
foreign.test Add `pointer?'. 2011-01-30 23:29:30 +01:00
format.test deprecate omission of port to ice-9 format 2010-12-18 12:06:53 +01:00
fractions.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
ftw.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
future.test futures: Support multiple-value returns. 2010-12-16 23:45:24 +01:00
gc.test Tweak the "unused modules are removed" test. 2009-12-11 23:27:47 +01:00
getopt-long.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
goops.test interpreted closures cons less. 2009-12-13 16:18:39 +01:00
guardians.test Merge branch 'master' into boehm-demers-weiser-gc 2009-08-18 00:06:45 +02:00
hash.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
hooks.test Enclose hooks tests in their own module. 2010-01-07 11:10:36 +01:00
i18n.test Fix i18n tests when no French locale is available. 2010-08-16 12:27:14 +02:00
import.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
interp.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
keywords.test Fix "coding:" cookies in the test suite. 2010-03-02 23:36:29 +01:00
list.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
load.test change remaining %nil -> #nil 2010-04-09 21:06:29 +02:00
match.test Fix pattern variable extraction in match' with ..1'. 2010-09-27 23:52:10 +02:00
modules.test resolve-module #:ensure argument 2010-06-10 20:03:15 +02:00
multilingual.nottest Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
net-db.test Change getaddrinfo' test to handle the GNU-specific EAI_NODATA'. 2011-01-05 22:17:26 +01:00
numbers.test Support non-real complex numbers with inexact zero imaginary part 2011-02-02 21:34:01 +01:00
optargs.test fix self-tail-calls for lexical procs with optional, rest, or kwargs 2010-12-10 16:07:58 +01:00
options.test fix up options.test 2010-09-25 12:12:45 +02:00
pairs.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
poe.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
popen-child.scm Fix hanging of popen.test 2010-07-01 22:16:54 +01:00
popen.test popen.test: Don't auto-compile `popen-child.scm'. 2010-09-01 15:03:24 +02:00
ports.test Change `scm_encoding_error' to pass the port and faulty character. 2011-02-02 18:06:29 +01:00
posix.test Add total-processor-count' and current-processor-count'. 2010-12-07 23:13:20 +01:00
print.test Improve handling of read macros in `pretty-print'. 2010-11-05 01:39:26 +01:00
procprop.test use procedure-minimum-arity in tests 2010-04-19 12:05:27 +02:00
procs.test Add compose', negate', and `const'. 2010-12-16 23:45:23 +01:00
q.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
r4rs.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
r5rs_pitfall.test Remove deprecation warnings from the build 2009-09-17 01:18:14 +01:00
r6rs-arithmetic-bitwise.test Implementation and test cases for the R6RS (rnrs arithmetic bitwise) 2010-05-20 21:18:02 -04:00
r6rs-arithmetic-fixnums.test Add two new sets of fast quotient and remainder operators 2011-01-30 23:00:38 +01:00
r6rs-arithmetic-flonums.test Add two new sets of fast quotient and remainder operators 2011-01-30 23:00:38 +01:00
r6rs-base.test Implement R6RS real-valued?', rational-valued?', `integer-valued?' 2011-01-30 13:08:53 +01:00
r6rs-conditions.test Some tweaks to the R6RS support 2010-11-25 23:04:12 +01:00
r6rs-control.test Implementation and test cases for the R6RS (rnrs control) library. 2010-05-20 21:18:02 -04:00
r6rs-enums.test Enumeration set universe comparisons should be done with `equal?' 2010-11-21 15:35:44 -05:00
r6rs-eval.test Fix typo in license comment. 2010-05-20 21:18:04 -04:00
r6rs-exceptions.test Add `guard' form and test cases to R6RS (rnrs exceptions) library. 2010-05-20 21:18:03 -04:00
r6rs-files.test Implementation and test cases for R6RS (rnrs files) library. 2010-05-20 21:18:03 -04:00
r6rs-hashtables.test Fix argument passing for external hash functions in `(rnrs hashtables)'. 2010-07-14 01:16:19 -04:00
r6rs-lists.test Explicit definitions for memp' and assp' in `(rnrs list)'; the predicate 2010-08-08 20:23:14 -04:00
r6rs-ports.test R6RS: Have put-char', put-string', etc. raise an `&i/o-encoding-error'. 2011-02-02 18:06:29 +01:00
r6rs-records-inspection.test Implementation for the R6RS (rnrs hashtables) library; 2010-05-20 21:18:02 -04:00
r6rs-records-procedural.test Fix test suite title in comment 2010-05-20 21:18:03 -04:00
r6rs-records-syntactic.test scheme-mode in syntactic records test 2010-06-19 15:40:47 +02:00
r6rs-unicode.test Implementation and test cases for the R6RS (rnrs unicode) library. 2010-05-20 21:18:03 -04:00
ramap.test implement transcendental sin, cos etc in c; deprecate $sin, $cos, etc 2009-12-03 15:27:35 +01:00
rdelim.test Have read-char' & co. throw to decoding-error'. 2011-02-02 18:06:28 +01:00
reader.test implement r6rs hungry escaped EOL 2011-01-21 09:24:32 +01:00
receive.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
records.test make-record-type slight refactor 2010-04-19 19:33:57 +02:00
regexp.test Fix `regexp.test' when the "en_US.utf8" locale isn't available. 2010-11-24 23:38:01 +01:00
rnrs-libraries.test r6rs `import' accepts multiple clauses 2010-06-09 08:55:02 +02:00
rnrs-test-a.scm add rnrs libraries test suite 2010-05-03 22:11:15 +02:00
session.test Fix for `submodules' in (ice-9 session) (closes #30062) 2010-09-02 21:47:04 -07:00
signals.test Add define-module to signals.test 2009-10-01 21:56:49 +01:00
socket.test Add a test for send' and recv!'. 2011-01-29 21:36:59 +01:00
sort.test gut trampolines 2009-12-01 21:00:23 +01:00
srcprop.test no special treatment for memoized code in srcprop.c 2009-12-01 21:00:26 +01:00
srfi-1.test SRFI-1: Make `fold-right' tail-recursive. 2010-10-08 15:25:56 +02:00
srfi-4.test Fix off-by-one error when initializing vectors in `make-srfi-4-vector'. 2010-03-02 23:16:26 +01:00
srfi-6.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
srfi-9.test Fix SRFI-9 for records without fields 2010-06-19 14:52:56 +02:00
srfi-10.test add quasisyntax 2009-11-14 17:25:12 +01:00
srfi-11.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
srfi-13.test Improved support for Unicode title case in Guile's string and character APIs. 2009-12-22 00:19:56 -05:00
srfi-14.test copyright dates 2010-04-03 06:46:23 -07:00
srfi-17.test adapt tests to new syntax-error form 2010-11-18 11:04:15 +01:00
srfi-18.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
srfi-19.test Have srfi-19.test' use the non-deprecated format' style. 2011-01-29 21:46:44 +01:00
srfi-26.test * tests/srfi-26.test: New. 2004-01-21 00:45:48 +00:00
srfi-27.test Add implementation of SRFI 27 2010-09-27 22:15:51 +02:00
srfi-31.test fix srfi-31 check after macroexpand rename 2010-03-19 17:05:46 +01:00
srfi-34.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
srfi-35.test Fix "coding:" cookies in the test suite. 2010-03-02 23:36:29 +01:00
srfi-37.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
srfi-38.test Add implementation of SRFI 38 2010-11-03 00:19:54 +01:00
srfi-39.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
srfi-42.test Add implementation of SRFI 42 2010-10-03 12:09:50 +02:00
srfi-45.test Add implementation of SRFI 45 2010-10-03 21:54:22 +02:00
srfi-60.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
srfi-67.test Add implementation of SRFI-67 2010-10-03 12:14:21 +02:00
srfi-69.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
srfi-88.test Fix "coding:" cookies in the test suite. 2010-03-02 23:36:29 +01:00
srfi-98.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
statprof.test statprof test traps fix; re-enable accurate call counting test 2010-09-25 12:09:13 +02:00
streams.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
strings.test Fix type-checking in the optimized path of `string=?'. 2010-07-13 00:08:09 +02:00
structs.test Optimize struct initialization and accessors for the common case. 2010-01-23 16:21:13 +01:00
sxml-match-tests.ss sxml-match: Handle multiple-value returns. 2010-05-26 23:41:23 +02:00
sxml.fold.test Remove `fold' from (sxml fold). 2010-04-09 00:32:14 +02:00
sxml.match.test Add (sxml match). 2010-05-25 23:31:36 +02:00
sxml.simple.test Have sxml->xml' handle *TOP*' nodes (bug #29260). 2010-05-11 23:46:05 +02:00
sxml.ssax.test update licenses on tests imported from guile-lib 2010-04-07 21:37:50 +02:00
sxml.transform.test update licenses on tests imported from guile-lib 2010-04-07 21:37:50 +02:00
sxml.xpath.test update licenses on tests imported from guile-lib 2010-04-07 21:37:50 +02:00
symbols.test Remove the distinction between inline/outline storage for stringbufs. 2009-09-01 02:02:43 +02:00
syncase.test fix (set! MACRO exp) hygiene 2010-07-09 17:05:02 +02:00
syntax.test adapt tests to new syntax-error form 2010-11-18 11:04:15 +01:00
texinfo.docbook.test update licenses on tests imported from guile-lib 2010-04-07 21:37:50 +02:00
texinfo.serialize.test update licenses on tests imported from guile-lib 2010-04-07 21:37:50 +02:00
texinfo.string-utils.test update licenses on tests imported from guile-lib 2010-04-07 21:37:50 +02:00
texinfo.test update licenses on tests imported from guile-lib 2010-04-07 21:37:50 +02:00
threads.test Implement `(ice-9 threads)' high-level constructs in terms of futures. 2010-12-16 23:45:24 +01:00
time.test Modify socket and time functions for wide strings 2009-08-23 09:29:45 -07:00
tree-il.test Tweak -Wunused-variable' and -Wunused-toplevel' for special names. 2010-10-20 23:45:59 +02:00
vectors.test fix vector-move-right! and vector-move-left! 2010-08-04 21:48:00 +02:00
version.test Relax the `(version)' test. 2010-05-30 22:39:23 +02:00
vlist.test Add vhash-fold*' in (ice-9 vlist)'. 2010-07-21 00:28:58 +02:00
weaks.test Allow arbitrary code in ASSOC procedures for weak hash tables (bug #29616). 2010-10-11 15:38:06 +02:00
web-http.test parse credentials and challenges 2011-01-10 09:31:29 -08:00
web-request.test (web response) and (web request): bodies are bytevectors 2011-01-10 22:44:36 -08:00
web-response.test (web response) and (web request): bodies are bytevectors 2011-01-10 22:44:36 -08:00
web-uri.test rename string->uri and uri->string. 2011-01-07 09:18:36 -08:00