Dimitris Apostolou
356dcb20ce
github #82 : Fix typos
2021-11-12 23:54:34 +01:00
Vincent Lefevre
4fa4dcad17
48723: locale-safe recognition of "Inf" and "NaN" constants in math
2021-05-15 14:11:49 -07:00
Jun-ichi Takimoto
0f62e07c80
48389: getkeystring() should not return ptr to local var
...
Now it returns NULL if called with GETKEY_SINGLE_CHAR and next character
is not found. Caller must check the return value.
2021-04-06 23:05:03 +09:00
Peter Stephenson
af1c009c3e
46079: Ignore double quotes in math expressions.
...
Treat as white space.
This is required for compatibility and previously had no use in zsh
as it generated an error.
2020-06-23 12:17:32 +01:00
Daniel Shahaf
581585dfc6
45343: Queue signals around arithmetic evaluations
...
The queueing added in execarith() in 45083 is reverted since the callee
does this now.
2020-01-29 09:02:49 +00:00
Martijn Dekker
4215fcb107
43944: apply NO_UNSET consistently to arithmeitc
2018-12-30 18:03:02 +00:00
Peter Stephenson
225b35c907
43261: Fix unary minus with base.
...
Apply unary minus to a complete lexical constant rather than the
first component that comes along.
2018-08-08 17:11:54 +01:00
Jun-ichi Takimoto
baedd62f0d
43219 (except term{cap,info}.c): fix several memory leaks
2018-07-31 22:15:58 +09:00
Oliver Kiddle
a93abe1170
42488: test cases for 42369 and address some issues in the code
2018-05-13 10:13:42 +02:00
Oliver Kiddle
373efa085d
Nelson H. F. Beebe: 19597 (rebased 42369): return Inf, NaN etc from floating point operations instead of errors to allow non-stop IEEE 754 arithmetic
2018-05-13 10:02:01 +02:00
Peter Stephenson
ea5b38935a
41641: Some math operations shouldn't be lvalues.
...
This includes pre- and post- increment and decrement. Simply
mark all values after operations as rvalues.
2017-09-05 13:15:30 +01:00
Peter Stephenson
f3f8537cfa
40760: Always tokenize unquoted - to Dash.
...
This fixes use of pattern match character ranges in unusual contexts.
Attempt to detect a tokenized - in cases where we don't care.
2017-03-07 10:43:58 +00:00
Peter Stephenson
47c05f6b66
40622 with typos fixed: functions -Ms.
...
This adds the capability for mathematical functions based on shell
functions to have a string argument. Module functions have had
this for a long time.
2017-03-01 10:01:01 +00:00
Peter Stephenson
de9effbce6
37018: Make WARNCREATEGLOBAL more consistent.
...
Wd don't need separate math handling any more, and can make it
output the function name in all cases.
2015-10-29 17:06:27 +00:00
Barton E. Schaefer
b970ef6ef5
unposted: strdup should be ztrdup
2015-10-21 15:13:45 -07:00
Daniel Shahaf
2654cb43f6
36651: WARN_CREATE_GLOBAL += math expressions
...
Without this, '() { (( x=42 )) }' and '() { for (( i=0; … )) }' wouldn't warn
about $x and $i, respectively, being created global.
2015-09-27 23:52:25 +00:00
Peter Stephenson
099e717c15
35359: Improved math parsing and errors.
...
Check for bogus trailing ")" at end of top-level parse.
Extend some math error messages to indicate they are math errors.
2015-06-02 10:21:55 +01:00
Peter Stephenson
493fe2b444
unposted: rewrite Nularg math handling to be like other cases
2015-04-15 18:14:27 +01:00
Peter Stephenson
2ef4b38461
34892 (slightly tweaked): math evaluation fix
...
An empty expression resulting from substitution includes a
Nularg, which needs handling the same as an empty string.
2015-04-15 10:20:06 +01:00
Peter Stephenson
3a99ef322d
34280: more widespread use of FORCE_FLOAT.
...
Add the case of variables read for use in arithmetic expressions.
2015-01-15 13:52:40 +00:00
Peter Stephenson
5f4325a0a4
Propagate float/integer type in arithmetic assignment.
...
Add test.
Mention this and also floating point mod change in README.
2015-01-12 16:38:00 +00:00
Barton E. Schaefer
39a6e8a7f5
34230: call fmod() for modulo with floats
2015-01-11 11:29:17 -08:00
Peter Stephenson
a8927bf27b
33793: add 0b binary interpretation to integer constants
2014-11-26 17:26:58 +00:00
Peter Stephenson
22b8fd6da9
32299: add use of underscores on arithmetic output for spacing
2014-01-23 10:32:59 +00:00
Peter Stephenson
4c611f9323
31982: detection of floating point constants was problematic.
...
Remove the cause and fix the original problem with floating point
numbers with leading zeros (users/17445) a different way.
2013-11-14 11:49:22 +00:00
Peter Stephenson
f77a7a5b18
31937: zle -Fw uses widget semantics for file descriptor handler
2013-11-07 15:19:07 +00:00
Bart Schaefer
f4b0833270
31353: fix handling of floating point in ternary
2013-04-30 00:18:13 -07:00
Mikael Magnusson
1d3d92a0c9
31140: avoid crash when hitting recursion limit
2013-03-13 19:54:20 +00:00
Peter Stephenson
3def943d04
users/17665: add FORCE_FLOAT option
2013-03-05 20:04:53 +00:00
Bart Schaefer
431c22024d
users/17445: fix handling of leading zeroes in floating point
2012-12-08 19:50:20 +00:00
Peter Stephenson
e550c98d69
30647, 30649: allow underscores in numeric constants
2012-09-11 16:02:41 +00:00
Peter Stephenson
361e171672
30656: prevent SIGFPE in division by -1 by multiplying instead
2012-09-06 18:22:30 +00:00
Peter Stephenson
962624e8c3
29491: remove some variables set but not used
2011-06-19 16:26:10 +00:00
Mikael Magnusson
bd2d0636d2
29329: fix undefined behaviour in math.c
2011-05-27 01:42:30 +00:00
Mikael Magnusson
72cb7cfc6f
29307, 29308 + replies: Fix some doubled words in docs and comments.
2011-05-19 16:10:46 +00:00
Peter Stephenson
e6f14352d6
28037: improved error messages for module autoloads
...
of math functions and builtins
2010-06-14 11:57:08 +00:00
Peter Stephenson
f02778f83c
27611: cache parameter values in math eval so subscripts are eval'd once
2010-01-20 17:17:45 +00:00
Peter Stephenson
3c248a0de4
25905: fix and test doubled-hash radix output
2008-10-16 09:34:51 +00:00
Peter Stephenson
b2d08a2155
25744: dynamic named directories and further doshfunc() simplification
2008-09-26 09:11:27 +00:00
Peter Stephenson
2920c227d3
25677: add %x and %I prompt escapes for shell source code debugging
...
tidy up interface to doshfunc()
2008-09-16 15:02:01 +00:00
Peter Stephenson
8a4af211c3
25149: add C_PRECEDENCES option to make arithmetic have C/Perl precedence
2008-06-12 13:45:04 +00:00
Peter Stephenson
1c29f641c6
Mikael: 25143: spelling corrections
...
25144: report supported bases
25139: fix number
2008-06-10 08:50:35 +00:00
Peter Stephenson
b86c191af5
25025: check radix for integer constants is between 2 and 36 inclusive
2008-05-14 10:48:26 +00:00
Peter Stephenson
c2c50bd0a0
23553: bit missed out
2007-06-15 10:02:24 +00:00
Peter Stephenson
2c92d005d7
23165: fix problems with bases: error if over 36 and don't interpret octal
2007-02-12 16:43:40 +00:00
Peter Stephenson
80acfd135c
22684: improve getkeystring() interface and make printf do octal escapes
2006-09-10 18:10:48 +00:00
Peter Stephenson
44e2e5979c
22558: declaration after statement
2006-07-26 13:19:25 +00:00
Peter Stephenson
4a67f24798
22544: Improve use of ztype tests for multibyte characters. Add
...
POSIX_IDENTIFIERS option to control allowability of multibyte
alphanumeric characters in parameter and module names.
2006-07-10 13:08:22 +00:00
Peter Stephenson
4cd7b957f3
22529: multibyte conversion in math expressions
2006-06-30 09:41:34 +00:00
Peter Stephenson
dd5602f59b
22474: use variable argument lists to improve error message handling
2006-05-30 22:35:03 +00:00