]> git.eshelyaron.com Git - emacs.git/commit
Several fixes for formatting bignums
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 31 Aug 2018 07:25:07 +0000 (00:25 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 31 Aug 2018 07:28:58 +0000 (00:28 -0700)
commitdb2fed3bdfb351c3283e481829ce687931d27a3d
tree4f2674ec4f4fe450fd483132b9ddcca48f9eaf81
parenta451c6ec12b7b024f347364becb10c49807513ed
Several fixes for formatting bignums

* src/bignum.c: Include stdlib.h, for abs.
(bignum_bufsize, bignum_to_c_string): New functions.
* src/bignum.c (bignum_to_string):
* src/print.c (print_vectorlike): Use them.
* src/editfns.c (styled_format): Instead of having a separate
buffer for sprintf (which does not work for bignums), just append
to the main buffer.  When formatting bignums, add support for the
standard integer flags -, #, 0, + and space.  Fix some comments.
Capitalize properly when formatting bignums with %X.  Use
functions like c_isdigit rather than reinventing the wheel.
Simplify computation of excess precision.
* src/print.c: Do not include bignum.h; no longer needed.
(print_vectorlike): Avoid recalculating string length.
* test/src/editfns-tests.el (format-bignum):
Test some of the above fixes.
src/bignum.c
src/editfns.c
src/lisp.h
src/print.c
test/src/editfns-tests.el