From: Kris K. <kj...@us...> - 2014-03-29 01:04:25
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Maxima CAS". The branch, master has been updated via 99edce69bd2b1ddaa67ece23ec508012e684d099 (commit) via 4e318fb7f4f11a003f37c8cac408b07205ba02d4 (commit) via fbbe81bdd36110d935de5e6d489bc3149a36e393 (commit) via 618442c43223527ccc4a552274a90243c159804f (commit) via 3f9b076d3627142002edb7e049eb39e58f25f8be (commit) from 3ac16eb0eb0d8145453c0cbc904366b987853068 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 99edce69bd2b1ddaa67ece23ec508012e684d099 Author: Kris Katterjohn <kat...@gm...> Date: Fri Mar 28 19:58:47 2014 -0500 Update src/sharefiles.mk diff --git a/src/sharefiles.mk b/src/sharefiles.mk index e1f81c2..e74dd00 100644 --- a/src/sharefiles.mk +++ b/src/sharefiles.mk @@ -503,6 +503,8 @@ contrib/Zeilberger/zeilberger.mac \ descriptive/biomed.data \ descriptive/descriptive.mac \ descriptive/pidigits.data \ +descriptive/rtest_descriptive.mac \ +descriptive/rtest_statgraph.mac \ descriptive/wind.data \ diffequations/abel.mac \ diffequations/desoln.mac \ commit 4e318fb7f4f11a003f37c8cac408b07205ba02d4 Author: Kris Katterjohn <kat...@gm...> Date: Fri Mar 28 18:19:53 2014 -0500 Remove 2 duplicate tests in tests/rtest_round.mac diff --git a/tests/rtest_round.mac b/tests/rtest_round.mac index e3e78e6..fc12abd 100644 --- a/tests/rtest_round.mac +++ b/tests/rtest_round.mac @@ -19,9 +19,6 @@ round(zerob); round(-3); -3$ -round(0); -0$ - round(42); 42$ @@ -157,9 +154,6 @@ truncate(zerob); truncate(-3); -3$ -truncate(0); -0$ - truncate(42); 42$ commit fbbe81bdd36110d935de5e6d489bc3149a36e393 Author: Kris Katterjohn <kat...@gm...> Date: Fri Mar 28 18:09:49 2014 -0500 Handle arguments of zeroa and zerob in round() and truncate() This is consistent with the behavior of ceiling() and floor(). The test suite runs fine, with new tests. diff --git a/src/nummod.lisp b/src/nummod.lisp index f5388dd..b8d739b 100644 --- a/src/nummod.lisp +++ b/src/nummod.lisp @@ -312,6 +312,8 @@ (setq e (simplifya (specrepcheck (second e)) z)) (cond (($featurep e '$integer) e) ;; takes care of round(round(x)) --> round(x). ((member e '($inf $minf $und $ind) :test #'eq) e) + ((eq e '$zerob) 0) + ((eq e '$zeroa) 0) (t (let* ((lb (take '($floor) e)) (ub (take '($ceiling) e)) @@ -343,6 +345,8 @@ (setq e (simplifya (specrepcheck (second e)) z)) (cond (($featurep e '$integer) e) ;; takes care of truncate(truncate(x)) --> truncate(x). ((member e '($inf $minf $und $ind) :test #'eq) e) + ((eq e '$zerob) 0) + ((eq e '$zeroa) 0) (t (let ((sgn (csign e))) (cond ((member sgn '($neg $nz) :test #'eq) (take '($ceiling) e)) diff --git a/tests/rtest_round.mac b/tests/rtest_round.mac index 2be832a..e3e78e6 100644 --- a/tests/rtest_round.mac +++ b/tests/rtest_round.mac @@ -10,6 +10,12 @@ round(0.0); round(0.0b0); 0$ +round(zeroa); +0$ + +round(zerob); +0$ + round(-3); -3$ @@ -142,6 +148,12 @@ truncate(0.0); truncate(0.0b0); 0$ +truncate(zeroa); +0$ + +truncate(zerob); +0$ + truncate(-3); -3$ commit 618442c43223527ccc4a552274a90243c159804f Author: Kris Katterjohn <kat...@gm...> Date: Fri Mar 28 17:54:42 2014 -0500 Add docs for truncate() diff --git a/doc/info/MathFunctions.texi b/doc/info/MathFunctions.texi index b783257..6cba09b 100644 --- a/doc/info/MathFunctions.texi +++ b/doc/info/MathFunctions.texi @@ -433,6 +433,22 @@ equation. See @mrefdot{distribute_over} @end deffn @c ----------------------------------------------------------------------------- +@anchor{truncate} +@deffn {Function} truncate (@var{x}) + +When @var{x} is a real number, return the closest integer to @var{x} not +greater in absolute value than @var{x}. Evaluation of @var{x} is similar +to @mref{floor} and @mrefdot{ceiling} + +The @code{truncate} function distributes over lists, matrices and equations. +See @mrefdot{distribute_over} + +@opencatbox +@category{Mathematical functions} +@closecatbox +@end deffn + +@c ----------------------------------------------------------------------------- @node Functions for Complex Numbers, Combinatorial Functions, Functions for Numbers, Mathematical Functions @section Functions for Complex Numbers @c ----------------------------------------------------------------------------- commit 3f9b076d3627142002edb7e049eb39e58f25f8be Author: Kris Katterjohn <kat...@gm...> Date: Fri Mar 28 17:49:43 2014 -0500 Update docs for floor(), ceiling() and round() These functions distribute over bags. See commits 74ae8da1 and 1a5f1298. diff --git a/doc/info/MathFunctions.texi b/doc/info/MathFunctions.texi index c29de8f..b783257 100644 --- a/doc/info/MathFunctions.texi +++ b/doc/info/MathFunctions.texi @@ -154,7 +154,9 @@ $$\left \lceil a \right \rceil$$ (%o7) false @end example -The function @code{ceiling} does not automatically map over lists or matrices. +The @code{ceiling} function distributes over lists, matrices and equations. +See @mrefdot{distribute_over} + Finally, for all inputs that are manifestly complex, @code{ceiling} returns a noun form. @@ -288,7 +290,9 @@ $$\left \lfloor a \right \rfloor$$ (%o7) false @end example -The function @code{floor} does not automatically map over lists or matrices. +The @code{floor} function distributes over lists, matrices and equations. +See @mrefdot{distribute_over} + Finally, for all inputs that are manifestly complex, @code{floor} returns a noun form. @@ -397,6 +401,9 @@ When @var{x} is a real number, returns the closest integer to @var{x}. Multiples of 1/2 are rounded to the nearest even integer. Evaluation of @var{x} is similar to @mref{floor} and @mrefdot{ceiling} +The @code{round} function distributes over lists, matrices and equations. +See @mrefdot{distribute_over} + @opencatbox @category{Mathematical functions} @closecatbox ----------------------------------------------------------------------- Summary of changes: doc/info/MathFunctions.texi | 27 +++++++++++++++++++++++++-- src/nummod.lisp | 4 ++++ src/sharefiles.mk | 2 ++ tests/rtest_round.mac | 18 ++++++++++++------ 4 files changed, 43 insertions(+), 8 deletions(-) hooks/post-receive -- Maxima CAS |