summaryrefslogtreecommitdiff
path: root/TODO
diff options
context:
space:
mode:
authorJames Youngman <jay@gnu.org>2008-08-02 21:49:46 +0100
committerJim Meyering <meyering@redhat.com>2008-08-06 08:47:55 +0200
commitf65cafd67b33009d23f940968bbe7f9a08d6fe13 (patch)
tree46b81ec96bceed2c2b7b6dffa3aa4e8646db952e /TODO
parentd9207b48a3e0763a7a93eb17c26ae5704b798d76 (diff)
downloadcoreutils-f65cafd67b33009d23f940968bbe7f9a08d6fe13.tar.xz
expr: support arbitrary-precision arithmetic
* src/Makefile.am (expr_LDADD): Link expr against GNU MP. * doc/coreutils.texi (expr invocation): Describe --bignum, --no-bignum. Explain the new arbitrary-precision functionality. * NEWS: Indicate that arbitrary-precision arithmetic is now supported in expr. * src/expr.c (enum valtype): Added mp_integer, signifying a GNU MP number. (usage): Document the new options --bignum and --no-bignum which force and prohibit the use of arbitrary-precision arithmetic, respectively. (long_options): data structure for getopt_long, which we need to use to parse the options mentioned above. (main): parse these options with getopt_long instead of parse_long_options. (valinfo): Downgrade the numeric member of the union from intmax_t to signed long, since MP lacks functions for promoting an intmax_t to an arbitrary-precision quantity. (enum arithmetic_mode): Represents the current choice between --bignum, --no-bignum and the default (automatically switch from one to the other if needed). (integer_overflow): issue a more explicit error message indicating that MP is not available. (string_too_long): new function, emits a fatal error message for the case where an argument to the 'index' expression is too long for a string offset to be represented. (int_value): With --bignum, create the value as mp_integer rather than plain integer. (substr_value): factored out of eval6; implements "substr". (freev): also destroy mp_integer values. Check that no mp_integer values exist if --no-bignum was specified. (printv, null, tostring): support mp_integer. (toint): new funtion for converting from string or mp_integer to integer. (getsize): extracts a size_t value from a VALUE object; used to implement substr. (promote): promotes a value from integer to mp_integer. (domult, dodivide): functions for multiplication and division, factored out of eval4. (doadd): addition/subraction function, factpred out of eval3. (eval3): support mp_integer types; call doadd. (eval4): support mp_integer types; call domult, dodivide. (eval6): support mp_integer offsets and lengths for "substr" and "index". * TODO: Mention that expr supports arbitrary-precision arithmetic, and suggest that this might also be a good idea for seq. * AUTHORS (expr): Add James Youngman.
Diffstat (limited to 'TODO')
-rw-r--r--TODO5
1 files changed, 5 insertions, 0 deletions
diff --git a/TODO b/TODO
index 18371b396..c7b095c35 100644
--- a/TODO
+++ b/TODO
@@ -155,6 +155,11 @@ remove all uses of the `register' keyword: Done. add a maint.mk rule
remove or adjust chown's --changes option, since it
can't always do what it currently says it does.
+Support arbitrary-precision arithmetic in those tools for which it
+makes sense. Factor and expr already support this via libgmp.
+The "test" program is covered via its string-based comparison of
+integers. To be converted: seq.
+
Adapt tools like wc, tr, fmt, etc. (most of the textutils) to be
multibyte aware. The problem is that I want to avoid duplicating
significant blocks of logic, yet I also want to incur only minimal