1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-29 16:30:19 +02:00
guile/doc/ref
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
..
.gitignore add www-commit rule in doc/ref 2010-12-17 16:41:58 +01:00
api-binding.texi letrec* in docs, and some r6rs fixes 2010-08-06 11:52:27 +02:00
api-compound.texi Add vhash-fold*' in (ice-9 vlist)'. 2010-07-21 00:28:58 +02:00
api-control.texi Document `scm_misc_error' (bug #31969). 2011-01-04 18:29:55 +01:00
api-coverage.texi Manual sections don't need a page break before 2010-10-31 08:34:05 +00:00
api-data.texi Support non-real complex numbers with inexact zero imaginary part 2011-02-02 21:34:01 +01:00
api-debug.texi proof-reading fixen in api-debug 2010-10-08 10:54:03 +02:00
api-deprecated.texi a number of doc fixes 2010-08-16 21:36:14 -07:00
api-evaluation.texi update api-evaluation.texi 2011-01-28 17:16:22 +01:00
api-foreign.texi Add `pointer?'. 2011-01-30 23:29:30 +01:00
api-i18n.texi Merge branch 'wip-manual-2' 2010-04-16 22:26:32 +01:00
api-init.texi Fix explicitely' typos, should be explicitly' 2009-05-20 18:51:03 +01:00
api-io.texi Have read-char' & co. throw to decoding-error'. 2011-02-02 18:06:28 +01:00
api-lalr.texi Manual sections don't need a page break before 2010-10-31 08:34:05 +00:00
api-languages.texi Merge branch 'wip-manual-2' 2010-04-16 22:26:32 +01:00
api-macros.texi macro documentation fixup 2011-02-02 20:55:14 +01:00
api-memory.texi a number of doc fixes 2010-08-16 21:36:14 -07:00
api-modules.texi add ,reload meta-command and document it and reload-module 2010-12-17 13:27:43 +01:00
api-options.texi document hungry-eol-escapes 2011-01-21 09:24:36 +01:00
api-overview.texi Manual typo fix 2010-12-23 12:17:26 +00:00
api-procedures.texi Add compose', negate', and `const'. 2010-12-16 23:45:23 +01:00
api-regex.texi Promote regex doc out of the `Simple Data Types' section 2010-10-31 08:24:28 +00:00
api-scheduling.texi Clarify doc regarding threading of par-map' and par-for-each'. 2010-12-17 21:55:56 +01:00
api-scm.texi * scheme-binding.texi: Renamed to api-binding.texi. 2004-08-02 12:29:00 +00:00
api-smobs.texi Remove page breaks except before new chapters and indices 2009-12-19 00:58:54 +00:00
api-snarf.texi Typos fixed. Use existing functions in explaining symbol and keyword 2004-08-25 19:02:34 +00:00
api-undocumented.texi Remove non-existent *environment* APIs from api-undocumented.texi 2010-09-11 16:34:19 +01:00
api-utility.texi Remove page breaks except before new chapters and indices 2009-12-19 00:58:54 +00:00
api.txt Changes in doc/ref: 2002-03-01 00:19:20 +00:00
autoconf.texi make the use of the 5-argument @xref command consistent 2009-12-18 01:21:55 +00:00
ChangeLog-2008 Rename ChangeLog' files to ChangeLog-2008'. 2008-09-12 21:49:58 +02:00
ChangeLog-goops-2008 Move GOOPS documentation into the main manual 2009-08-03 23:29:45 +01:00
ChangeLog-guile-doc-ref
compiler.texi fix <letrec> docs 2010-08-27 09:16:44 -07:00
data-rep.texi update "data representation" part of guile internals doc 2010-03-14 14:39:47 +01:00
effective-version.texi.in Add an effective version variable for the manual 2009-08-04 12:08:02 +01:00
expect.texi Remove page breaks except before new chapters and indices 2009-12-19 00:58:54 +00:00
fdl.texi Upgrade manual to GFDLv1.3+. 2010-06-01 00:02:35 +02:00
gds.dia replace ascii figures with scalable ps/pdf versions. 2009-12-17 23:17:59 +00:00
gds.eps replace ascii figures with scalable ps/pdf versions. 2009-12-17 23:17:59 +00:00
gds.pdf replace ascii figures with scalable ps/pdf versions. 2009-12-17 23:17:59 +00:00
gds.txt replace ascii figures with scalable ps/pdf versions. 2009-12-17 23:17:59 +00:00
goops-tutorial.texi Merge tutorial' and reference' treatments of the same basic GOOPS 2010-12-06 22:28:39 +00:00
goops.texi Confront the MOP 2011-01-14 21:53:37 +00:00
guile.texi Update copyright date of manual, and a small fix 2011-02-01 21:07:39 +01:00
hierarchy.eps Move GOOPS documentation into the main manual 2009-08-03 23:29:45 +01:00
hierarchy.pdf Move GOOPS documentation into the main manual 2009-08-03 23:29:45 +01:00
hierarchy.png Move GOOPS documentation into the main manual 2009-08-03 23:29:45 +01:00
hierarchy.txt Move GOOPS documentation into the main manual 2009-08-03 23:29:45 +01:00
history.texi Typeset Ludo's name correctly 2010-10-03 23:17:54 +01:00
indices.texi Big reorganization of the whole manual to give it a simpler structure. 2004-04-21 14:33:05 +00:00
intro.texi Fix incorrect uses of en-dashes and em-dashes in the intro. 2010-11-19 14:28:40 +01:00
libguile-concepts.texi Merge branch 'master' into wip-manual-2 2010-04-10 13:32:42 +01:00
libguile-extensions.texi In general, use @lisp in preference to @smalllisp 2009-08-09 15:04:08 +01:00
libguile-linking.texi Update manual examples of how to link with Guile 2010-03-22 22:13:35 +01:00
libguile-program.texi Remove page breaks except before new chapters and indices 2009-12-19 00:58:54 +00:00
libguile-smobs.texi update "data representation" part of guile internals doc 2010-03-14 14:39:47 +01:00
libguile-snarf.texi more typo fixes 2009-12-18 00:53:34 +00:00
make-texinfo.scm Remove dependency on GNU Make and reliance on /usr/bin/env. 2010-01-03 19:06:52 +01:00
Makefile.am Don't remove `standard-library.texi' upon "make clean". 2011-01-29 23:31:38 +01:00
match.texi Document (ice-9 match). 2010-08-27 18:59:43 +02:00
misc-modules.texi fix format ~f documentation for width combined with overflowchar 2011-01-26 20:13:31 +01:00
mod-getopt-long.texi Big reorganization of the whole manual to give it a simpler structure. 2004-04-21 14:33:05 +00:00
mop.text Move GOOPS documentation into the main manual 2009-08-03 23:29:45 +01:00
new-docstrings.texi Automatic manual updates following libguile docstring changes 2009-12-27 23:24:09 +00:00
posix.texi Have recv!', send', etc. accept a bytevector. 2011-01-29 21:36:59 +01:00
preface.texi preface contributors tweaks 2010-10-11 23:32:30 +02:00
r6rs.texi Update copyright date of manual, and a small fix 2011-02-01 21:07:39 +01:00
repl-modules.texi debug and readline options doc tweak 2010-10-01 11:15:12 +02:00
scheme-ideas.texi Fix inconsistent sectioning, causing make to fail 2010-04-26 22:18:45 +01:00
scheme-indices.texi Added Copyright notice. 2004-01-21 22:40:39 +00:00
scheme-intro.texi Update and simplify statement about RnRS support 2009-12-18 01:21:55 +00:00
scheme-reading.texi Remove page breaks except before new chapters and indices 2009-12-19 00:58:54 +00:00
scheme-scripts.texi Document missing Guile command line options 2011-01-15 20:57:01 +00:00
scheme-using.texi add ,reload meta-command and document it and reload-module 2010-12-17 13:27:43 +01:00
scheme.dia replace ascii figures with scalable ps/pdf versions. 2009-12-17 23:17:59 +00:00
scheme.eps replace ascii figures with scalable ps/pdf versions. 2009-12-17 23:17:59 +00:00
scheme.pdf replace ascii figures with scalable ps/pdf versions. 2009-12-17 23:17:59 +00:00
scheme.txt replace ascii figures with scalable ps/pdf versions. 2009-12-17 23:17:59 +00:00
script-getopt.texi Remove page breaks except before new chapters and indices 2009-12-19 00:58:54 +00:00
scsh.texi update scsh doc 2010-08-17 08:48:49 -07:00
slib.texi added brief introduction about SLIB 2009-12-18 00:51:20 +00:00
srfi-modules.texi Add implementation of SRFI 38 2010-11-03 00:19:54 +01:00
standard-library.am Remove dependency on GNU Make and reliance on /usr/bin/env. 2010-01-03 19:06:52 +01:00
standard-library.scm integrate guile-lib docs 2009-12-21 00:01:49 +01:00
sxml-match.texi Document (ice-9 match). 2010-08-27 18:59:43 +02:00
tools.texi [maint] Remove unused script guile-doc-snarf. 2010-07-22 21:10:38 +02:00
tour.texi minor doc fixups 2010-10-12 13:01:30 +02:00
vm.texi Update example disassemblies 2010-05-02 14:18:58 +02:00
web.texi web.texi fix 2011-01-22 19:56:23 +01:00