<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs/test/lisp/calc, branch scratch/annotation-function-improvements</title>
<subtitle>Emacs is the extensible, customizable, self-documenting real-time display editor. 
</subtitle>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/'/>
<entry>
<title>Calc: control digits after decimal point (bug#47302)</title>
<updated>2021-04-27T16:10:01+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2021-04-27T15:36:15+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=7133a67dcdb68fc16d71c3d45323baba8ac5afe9'/>
<id>7133a67dcdb68fc16d71c3d45323baba8ac5afe9</id>
<content type='text'>
Calc normally displays a trailing decimal point for floats with no
fractional part, like '12.'. Some uses require at least one digit
after the point; add the governing variable calc-digit-after-point.

* lisp/calc/calc.el (calc-digit-after-point): New variable.
(math-format-number): Use it.
* test/lisp/calc/calc-tests.el (calc-display-digit-after-point):
New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Calc normally displays a trailing decimal point for floats with no
fractional part, like '12.'. Some uses require at least one digit
after the point; add the governing variable calc-digit-after-point.

* lisp/calc/calc.el (calc-digit-after-point): New variable.
(math-format-number): Use it.
* test/lisp/calc/calc-tests.el (calc-display-digit-after-point):
New test.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix multiple Calc defmath errors (bug#46750)</title>
<updated>2021-03-01T19:59:52+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2021-03-01T19:52:39+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=08b11a02f49da5ca0e4e58a32fa853df0c5e0214'/>
<id>08b11a02f49da5ca0e4e58a32fa853df0c5e0214</id>
<content type='text'>
Fix incorrect variable scoping in `let*`, `for` and `foreach`.
Fix loop variable value in `foreach` (should be element, not tail).
Fix function quoting, as in ('cons x y) -- didn't work at all.

Reported by Stephan Neuhaus.

* lisp/calc/calc-prog.el (math-define-exp, math-handle-foreach):
* test/lisp/calc/calc-tests.el: (var-g, test1, test2, test3, test4)
(test5, test6, test7, calc-defmath): Test various defmath forms.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix incorrect variable scoping in `let*`, `for` and `foreach`.
Fix loop variable value in `foreach` (should be element, not tail).
Fix function quoting, as in ('cons x y) -- didn't work at all.

Reported by Stephan Neuhaus.

* lisp/calc/calc-prog.el (math-define-exp, math-handle-foreach):
* test/lisp/calc/calc-tests.el: (var-g, test1, test2, test3, test4)
(test5, test6, test7, calc-defmath): Test various defmath forms.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright year to 2021</title>
<updated>2021-01-01T09:13:56+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2021-01-01T09:13:56+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=ba05d005e5a81bc123ad8da928b1bccb6b160e7a'/>
<id>ba05d005e5a81bc123ad8da928b1bccb6b160e7a</id>
<content type='text'>
Run "TZ=UTC0 admin/update-copyright".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Run "TZ=UTC0 admin/update-copyright".
</pre>
</div>
</content>
</entry>
<entry>
<title>Calc: allow infinite binary word size (bug#43764)</title>
<updated>2020-10-13T09:29:01+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2020-10-10T16:02:49+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=cf407958886e46881216a510efebb8bc029de50c'/>
<id>cf407958886e46881216a510efebb8bc029de50c</id>
<content type='text'>
Setting the word size ("b w") to 0 removes the word size clipping for
all bit operations (effectively as if a word size of -∞ had been set).
Rotation is disallowed; logical and arithmetic shifts behave
identically.

After a suggestion by Vincent Belaïche.

* lisp/calc/calc-bin.el (calc-word-size, math-binary-arg)
(math-binary-modulo-args, calcFunc-lsh, calcFunc-ash, calcFunc-rot)
(math-clip, math-format-twos-complement): Allow a word size of 0,
meaning -∞.
* test/lisp/calc/calc-tests.el
(calc-tests--not, calc-tests--and, calc-tests--or, calc-tests--xor)
(calc-tests--diff): New functions.
(calc-tests--clip, calc-tests--rot, calc-shift-binary): Extend to
cover word size 0.
(calc-bit-ops): New test.
* doc/misc/calc.texi (Binary Functions): Update manual.
* etc/NEWS: Announce the change.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Setting the word size ("b w") to 0 removes the word size clipping for
all bit operations (effectively as if a word size of -∞ had been set).
Rotation is disallowed; logical and arithmetic shifts behave
identically.

After a suggestion by Vincent Belaïche.

* lisp/calc/calc-bin.el (calc-word-size, math-binary-arg)
(math-binary-modulo-args, calcFunc-lsh, calcFunc-ash, calcFunc-rot)
(math-clip, math-format-twos-complement): Allow a word size of 0,
meaning -∞.
* test/lisp/calc/calc-tests.el
(calc-tests--not, calc-tests--and, calc-tests--or, calc-tests--xor)
(calc-tests--diff): New functions.
(calc-tests--clip, calc-tests--rot, calc-shift-binary): Extend to
cover word size 0.
(calc-bit-ops): New test.
* doc/misc/calc.texi (Binary Functions): Update manual.
* etc/NEWS: Announce the change.
</pre>
</div>
</content>
</entry>
<entry>
<title>Calc: revert to old precedence of '/' in (La)TeX input mode</title>
<updated>2020-10-13T09:29:01+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2020-10-11T16:28:39+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=add1314195b193f04164cebe558d7a185b61de96'/>
<id>add1314195b193f04164cebe558d7a185b61de96</id>
<content type='text'>
Make the '/' precedence higher than that of '+' and '-' again,
partially reverting fda9b316f84 (bug#43902).

* lisp/calc/calc-lang.el (tex): Change precedence of '/'.
* test/lisp/calc/calc-tests.el (calc-latex-input): New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make the '/' precedence higher than that of '+' and '-' again,
partially reverting fda9b316f84 (bug#43902).

* lisp/calc/calc-lang.el (tex): Change precedence of '/'.
* test/lisp/calc/calc-tests.el (calc-latex-input): New test.
</pre>
</div>
</content>
</entry>
<entry>
<title>Calc: make tests less chatty</title>
<updated>2020-10-13T09:17:35+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2020-10-11T09:24:03+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=721b8468d28fec84a63bbef9da9f2016670decdc'/>
<id>721b8468d28fec84a63bbef9da9f2016670decdc</id>
<content type='text'>
* test/lisp/calc/calc-tests.el (calc-extract-units, calc-convert-units)
(calc-matrix-determinant, calc-choose): Remove "Working..." messages.
(calc-tests--check-choose, calc-tests--explain-choose): Eliminate.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* test/lisp/calc/calc-tests.el (calc-extract-units, calc-convert-units)
(calc-matrix-determinant, calc-choose): Remove "Working..." messages.
(calc-tests--check-choose, calc-tests--explain-choose): Eliminate.
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve coverage of Calc bit shift test</title>
<updated>2020-10-10T09:29:43+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2020-10-10T09:29:43+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=1006eb119849e4f81aa9a0b1c214a72bc2fbf8e3'/>
<id>1006eb119849e4f81aa9a0b1c214a72bc2fbf8e3</id>
<content type='text'>
* test/lisp/calc/calc-tests.el (calc-tests--rsh, calc-tests--rash)
(calc-shift-binary): Test with negative word sizes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* test/lisp/calc/calc-tests.el (calc-tests--rsh, calc-tests--rash)
(calc-shift-binary): Test with negative word sizes.
</pre>
</div>
</content>
</entry>
<entry>
<title>Calc: fix arithmetic right shift sign bit detection</title>
<updated>2020-10-09T09:24:15+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2020-10-09T09:12:53+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=35478f3f76d55f640372028889c570647432859c'/>
<id>35478f3f76d55f640372028889c570647432859c</id>
<content type='text'>
Arithmetic right shift didn't compute the bit to shift in correctly.
For example, #x600000000 right-shifted 8 steps (with 32 bit word size)
resulted in #xff000000 rather than 0. (Bug#43764)

* lisp/calc/calc-bin.el (calcFunc-ash): Fix condition.
* test/lisp/calc/calc-tests.el (calc-tests--clip, calc-tests--lsh)
(calc-tests--rsh, calc-tests--ash, calc-tests--rash, calc-tests--rot):
New.
(calc-shift-binary): New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Arithmetic right shift didn't compute the bit to shift in correctly.
For example, #x600000000 right-shifted 8 steps (with 32 bit word size)
resulted in #xff000000 rather than 0. (Bug#43764)

* lisp/calc/calc-bin.el (calcFunc-ash): Fix condition.
* test/lisp/calc/calc-tests.el (calc-tests--clip, calc-tests--lsh)
(calc-tests--rsh, calc-tests--ash, calc-tests--rash, calc-tests--rot):
New.
(calc-shift-binary): New test.
</pre>
</div>
</content>
</entry>
<entry>
<title>Calc: fix formatting and parsing Unix time (bug#43759)</title>
<updated>2020-10-02T20:24:54+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2020-10-02T16:50:50+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=0ade20f49f80d2d93f596ba9dfa3f1309ad84126'/>
<id>0ade20f49f80d2d93f596ba9dfa3f1309ad84126</id>
<content type='text'>
The number of days from epoch to Jan 1, 1970 that was used in parsing
and formatting Unix time was incorrect.  The previous fix
(in e368697ce36) was incomplete.

Reported by Vincent Belaïche.

* lisp/calc/calc-forms.el (math-unix-epoch): New constant.
(math-format-date-part, math-parse-standard-date, calcFunc-unixtime):
Use math-unix-epoch instead of a constant that is sometimes wrong.
* test/lisp/calc/calc-tests.el (calc-unix-date): New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The number of days from epoch to Jan 1, 1970 that was used in parsing
and formatting Unix time was incorrect.  The previous fix
(in e368697ce36) was incomplete.

Reported by Vincent Belaïche.

* lisp/calc/calc-forms.el (math-unix-epoch): New constant.
(math-format-date-part, math-parse-standard-date, calcFunc-unixtime):
Use math-unix-epoch instead of a constant that is sometimes wrong.
* test/lisp/calc/calc-tests.el (calc-unix-date): New test.
</pre>
</div>
</content>
</entry>
<entry>
<title>Calc: fix business days calculation (bug43677)</title>
<updated>2020-10-02T08:35:52+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2020-09-30T21:57:27+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=4cb16b6f42ea7ea088fa4134f8fe4ccfec16a56d'/>
<id>4cb16b6f42ea7ea088fa4134f8fe4ccfec16a56d</id>
<content type='text'>
The calculation of business days was broken in 2012 (probably
310e60d9454fe2 or thereabouts) when the date representation changed
epoch so that Jan 1, 1 AD became day number 1 instead of 0.  Repair
this, along with an unrelated bug that prevented arbitrary holiday
weekdays from working.

Reported by Aaron Zeng.

* lisp/calc/calc-forms.el (math-to-business-day)
(math-from-business-day): Correct calculation of weekdays using Calc's
current (Rata Die) chronology.  Modify loop condition to cope with odd
sets of holiday weekdays.
* test/lisp/calc/calc-tests.el (calc-business-days): New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The calculation of business days was broken in 2012 (probably
310e60d9454fe2 or thereabouts) when the date representation changed
epoch so that Jan 1, 1 AD became day number 1 instead of 0.  Repair
this, along with an unrelated bug that prevented arbitrary holiday
weekdays from working.

Reported by Aaron Zeng.

* lisp/calc/calc-forms.el (math-to-business-day)
(math-from-business-day): Correct calculation of weekdays using Calc's
current (Rata Die) chronology.  Modify loop condition to cope with odd
sets of holiday weekdays.
* test/lisp/calc/calc-tests.el (calc-business-days): New test.
</pre>
</div>
</content>
</entry>
</feed>
