summaryrefslogtreecommitdiff
path: root/Src/math.c
AgeCommit message (Collapse)AuthorFilesLines
2024-02-2452597: fix character counts in context of operator and operand errorsBart Schaefer1-7/+18
2024-01-2452492: prevent indexing error on recursive arithmetic in array subscriptBart Schaefer1-1/+6
Operator returns error when operand returns error
2023-06-2251887: namespaces recognized in math, incorrect usages rejected.Bart Schaefer1-3/+7
2022-12-1651212: remove STOUC() macroOliver Kiddle1-1/+1
This served as a workaround for ancient compilers where casts to unsigned char were broken.
2021-11-3049611 based on 49590 (Martijn Dekker): disable Inf and NaN in math ↵Oliver Kiddle1-1/+1
expressions for sh emulation
2021-11-12github #82: Fix typosDimitris Apostolou1-2/+2
2021-05-1548723: locale-safe recognition of "Inf" and "NaN" constants in mathVincent Lefevre1-2/+6
2021-04-0648389: getkeystring() should not return ptr to local varJun-ichi Takimoto1-1/+6
Now it returns NULL if called with GETKEY_SINGLE_CHAR and next character is not found. Caller must check the return value.
2020-06-2346079: Ignore double quotes in math expressions.Peter Stephenson1-0/+2
Treat as white space. This is required for compatibility and previously had no use in zsh as it generated an error.
2020-01-2945343: Queue signals around arithmetic evaluationsDaniel Shahaf1-4/+11
The queueing added in execarith() in 45083 is reverted since the callee does this now.
2018-12-3043944: apply NO_UNSET consistently to arithmeitcMartijn Dekker1-0/+2
2018-08-0843261: Fix unary minus with base.Peter Stephenson1-2/+13
Apply unary minus to a complete lexical constant rather than the first component that comes along.
2018-07-3143219 (except term{cap,info}.c): fix several memory leaksJun-ichi Takimoto1-1/+1
2018-05-1342488: test cases for 42369 and address some issues in the codeOliver Kiddle1-18/+19
2018-05-13Nelson H. F. Beebe: 19597 (rebased 42369): return Inf, NaN etc from floating ↵Oliver Kiddle1-4/+46
point operations instead of errors to allow non-stop IEEE 754 arithmetic
2017-09-0541641: Some math operations shouldn't be lvalues.Peter Stephenson1-8/+2
This includes pre- and post- increment and decrement. Simply mark all values after operations as rvalues.
2017-03-0740760: Always tokenize unquoted - to Dash.Peter Stephenson1-3/+4
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-0140622 with typos fixed: functions -Ms.Peter Stephenson1-10/+22
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.
2015-10-2937018: Make WARNCREATEGLOBAL more consistent.Peter Stephenson1-26/+0
Wd don't need separate math handling any more, and can make it output the function name in all cases.
2015-10-21unposted: strdup should be ztrdupBarton E. Schaefer1-1/+1
2015-09-2736651: WARN_CREATE_GLOBAL += math expressionsDaniel Shahaf1-0/+25
Without this, '() { (( x=42 )) }' and '() { for (( i=0; … )) }' wouldn't warn about $x and $i, respectively, being created global.
2015-06-0235359: Improved math parsing and errors.Peter Stephenson1-7/+14
Check for bogus trailing ")" at end of top-level parse. Extend some math error messages to indicate they are math errors.
2015-04-15unposted: rewrite Nularg math handling to be like other casesPeter Stephenson1-2/+6
2015-04-1534892 (slightly tweaked): math evaluation fixPeter Stephenson1-2/+2
An empty expression resulting from substitution includes a Nularg, which needs handling the same as an empty string.
2015-01-1534280: more widespread use of FORCE_FLOAT.Peter Stephenson1-1/+12
Add the case of variables read for use in arithmetic expressions.
2015-01-12Propagate float/integer type in arithmetic assignment.Peter Stephenson1-1/+28
Add test. Mention this and also floating point mod change in README.
2015-01-1134230: call fmod() for modulo with floatsBarton E. Schaefer1-3/+5
2014-11-2633793: add 0b binary interpretation to integer constantsPeter Stephenson1-2/+4
2014-01-2332299: add use of underscores on arithmetic output for spacingPeter Stephenson1-10/+25
2013-11-1431982: detection of floating point constants was problematic.Peter Stephenson1-8/+3
Remove the cause and fix the original problem with floating point numbers with leading zeros (users/17445) a different way.
2013-11-0731937: zle -Fw uses widget semantics for file descriptor handlerPeter Stephenson1-3/+20
2013-04-3031353: fix handling of floating point in ternaryBart Schaefer1-1/+2
2013-03-1331140: avoid crash when hitting recursion limitMikael Magnusson1-1/+2
2013-03-05users/17665: add FORCE_FLOAT optionPeter Stephenson1-0/+15
2012-12-08users/17445: fix handling of leading zeroes in floating pointBart Schaefer1-1/+2
2012-09-1130647, 30649: allow underscores in numeric constantsPeter Stephenson1-6/+33
2012-09-0630656: prevent SIGFPE in division by -1 by multiplying insteadPeter Stephenson1-3/+23
2011-06-1929491: remove some variables set but not usedPeter Stephenson1-2/+0
2011-05-2729329: fix undefined behaviour in math.cMikael Magnusson1-1/+2
2011-05-1929307, 29308 + replies: Fix some doubled words in docs and comments.Mikael Magnusson1-1/+1
2010-06-1428037: improved error messages for module autoloadsPeter Stephenson1-1/+2
of math functions and builtins
2010-01-2027611: cache parameter values in math eval so subscripts are eval'd oncePeter Stephenson1-14/+71
2008-10-1625905: fix and test doubled-hash radix outputPeter Stephenson1-1/+2
2008-09-2625744: dynamic named directories and further doshfunc() simplificationPeter Stephenson1-1/+1
2008-09-1625677: add %x and %I prompt escapes for shell source code debuggingPeter Stephenson1-3/+3
tidy up interface to doshfunc()
2008-06-1225149: add C_PRECEDENCES option to make arithmetic have C/Perl precedencePeter Stephenson1-117/+229
2008-06-10Mikael: 25143: spelling correctionsPeter Stephenson1-1/+2
25144: report supported bases 25139: fix number
2008-05-1425025: check radix for integer constants is between 2 and 36 inclusivePeter Stephenson1-0/+4
2007-06-1523553: bit missed outPeter Stephenson1-1/+12
2007-02-1223165: fix problems with bases: error if over 36 and don't interpret octalPeter Stephenson1-9/+25