Skip to content

Commit fc00dce

Browse files
committed
Bump version, document new financial functions
1 parent 0b8848c commit fc00dce

File tree

5 files changed

+42
-13
lines changed

5 files changed

+42
-13
lines changed

docs/TinyExpr++ReferenceManual.pdf

1.15 KB
Binary file not shown.

docs/functions.html

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ <h1 class="title"><span class="chapter-number">3</span>&nbsp; <span class="chapt
286286

287287

288288
<p>The following built-in functions are available:</p>
289-
<div>
290289
<table class="caption-top table">
291290
<caption>Math Functions</caption>
292291
<colgroup>
@@ -482,7 +481,6 @@ <h1 class="title"><span class="chapter-number">3</span>&nbsp; <span class="chapt
482481
</tr>
483482
</tbody>
484483
</table>
485-
</div>
486484
<div class="warningsection">
487485
<p><code>ISNA()</code> differs from some spreadsheet programs for certain expressions, such as divisions by zero. <em>TinyExpr++</em> will return true for this situation, while <em>Excel</em> will return false. This is because <em>Excel</em> distinguishes between <code>#DIV/0!</code> and <code>#N/A</code> errors, while <em>TinyExpr++</em> treats all invalid numbers (e.g., NaN, INF, -INF) as NaN.</p>
488486
</div>
@@ -647,14 +645,17 @@ <h1 class="title"><span class="chapter-number">3</span>&nbsp; <span class="chapt
647645
</tr>
648646
<tr class="even">
649647
<td style="text-align: left;">NOT(Value)</td>
650-
<td style="text-align: left;">Returns the logical negation of <em>Value.</em></td>
648+
<td style="text-align: left;">Returns the logical negation of <em>Value</em>.</td>
651649
</tr>
652650
<tr class="odd">
653651
<td style="text-align: left;">OR(Value1, Value2, …)</td>
654652
<td style="text-align: left;">Returns true if any condition is true.</td>
655653
</tr>
656654
</tbody>
657655
</table>
656+
<div class="warningsection">
657+
<p><code>AND</code> and <code>OR</code> ignore NaN arguments during evaluation, so results may differ from <em>Excel</em> when subexpressions resolve to NaN.</p>
658+
</div>
658659
</div>
659660
<div class="notesection">
660661
<p>The first argument to any logic function must be valid (i.e., not NaN). If the first argument evaluates to NaN, then NaN will be returned. Any subsequent arguments that evaluate to NaN will be ignored.</p>
@@ -674,6 +675,14 @@ <h1 class="title"><span class="chapter-number">3</span>&nbsp; <span class="chapt
674675
</thead>
675676
<tbody>
676677
<tr class="odd">
678+
<td style="text-align: left;">CUMIPMT(Rate, Periods, PresentValue, StartPeriod, EndPeriod, Type)</td>
679+
<td style="text-align: left;">Returns the cumulative interest paid on a loan between <em>StartPeriod</em> and <em>EndPeriod</em>, inclusive.<br>Type* specifies when payments are due: 0 = end of period, 1 = beginning of period.<br>NaN will be returned if <em>Rate</em> &lt;= 0, <em>Periods</em> &lt;= 0, <em>PresentValue</em> &lt;= 0, if <em>StartPeriod</em> or <em>EndPeriod</em> are out of range, or if <em>Type</em> is not 0 or 1.</td>
680+
</tr>
681+
<tr class="even">
682+
<td style="text-align: left;">CUMPRINC(Rate, Periods, PresentValue, StartPeriod, EndPeriod, Type)</td>
683+
<td style="text-align: left;">Returns the cumulative principal paid on a loan between <em>StartPeriod</em> and <em>EndPeriod</em>, inclusive.<br>Note that <em>Type</em> specifies when payments are due: 0 = end of period, 1 = beginning of period.<br>NaN will be returned if <em>Rate</em> &lt;= 0, <em>Periods</em> &lt;= 0, <em>PresentValue</em> &lt;= 0, if <em>StartPeriod</em> or <em>EndPeriod</em> are out of range, or if <em>Type</em> is not 0 or 1.</td>
684+
</tr>
685+
<tr class="odd">
677686
<td style="text-align: left;">DB(Cost, Salvage, Lifetime, Period, Month)</td>
678687
<td style="text-align: left;">Returns the depreciation of an asset for a specified period using the fixed-declining balance method.</td>
679688
</tr>
@@ -682,10 +691,30 @@ <h1 class="title"><span class="chapter-number">3</span>&nbsp; <span class="chapt
682691
<td style="text-align: left;">Returns the effective annual interest rate, provided the nominal annual interest rate and the number of compounding periods per year.<br>NaN will be returned if <em>Periods</em> is &lt; 1 or if <em>NominalRate</em> &lt;= 0.</td>
683692
</tr>
684693
<tr class="odd">
694+
<td style="text-align: left;">FV(Rate, Periods, Payment, [PresentValue], [Type])</td>
695+
<td style="text-align: left;">Returns the future value of an investment based on a constant interest rate, a fixed number of periods, and periodic payments.<br>Note that <em>PresentValue</em> and <em>Type</em> are optional and default to 0.<br>Also, <em>Type</em> specifies when payments are due: 0 = end of period, 1 = beginning of period.<br>NaN will be returned if <em>Periods</em> &lt;= 0 or if any required argument is not finite.</td>
696+
</tr>
697+
<tr class="even">
698+
<td style="text-align: left;">IPMT(Rate, Period, Periods, PresentValue, [FutureValue], [Type])</td>
699+
<td style="text-align: left;">Returns the interest portion of a payment for a specified period of an investment.<br>FutureValue* and <em>Type</em> are optional and default to 0.<br>Type* specifies when payments are due: 0 = end of period, 1 = beginning of period.</td>
700+
</tr>
701+
<tr class="odd">
685702
<td style="text-align: left;">NOMINAL(EffectiveRate, Periods)</td>
686703
<td style="text-align: left;">Returns the nominal annual interest rate, provided the effective rate and the number of compounding periods per year.<br>NaN will be returned if <em>Periods</em> is &lt; 1 or if <em>EffectiveRate</em> &lt;= 0.</td>
687704
</tr>
688705
<tr class="even">
706+
<td style="text-align: left;">NPER(Rate, Payment, PresentValue, [FutureValue], [Type])</td>
707+
<td style="text-align: left;">Returns the number of periods for an investment or loan based on a constant interest rate, periodic payments, and present and future values.<br>Note that <em>FutureValue</em> and <em>Type</em> are optional and default to 0.<br>Also, <em>Type</em> specifies when payments are due: 0 = end of period, 1 = beginning of period.<br>NaN will be returned if any required argument is not finite or if the calculation is not defined.</td>
708+
</tr>
709+
<tr class="odd">
710+
<td style="text-align: left;">PMT(Rate, Periods, PresentValue, [FutureValue], [Type])</td>
711+
<td style="text-align: left;">Returns the periodic payment for an investment or loan based on a constant interest rate, a fixed number of periods, and a present value.<br>Note that <em>FutureValue</em> and <em>Type</em> are optional and default to 0.<br>Also, <em>Type</em> specifies when payments are due: 0 = end of period, 1 = beginning of period.<br>NaN will be returned if <em>Periods</em> &lt;= 0 or if any required argument is not finite.</td>
712+
</tr>
713+
<tr class="even">
714+
<td style="text-align: left;">PPMT(Rate, Period, Periods, PresentValue, [FutureValue], [Type])</td>
715+
<td style="text-align: left;">Returns the principal portion of a payment for a specified period of an investment.<br>Note that <em>FutureValue</em> and <em>Type</em> are optional and default to 0.<br>Also, <em>Type</em> specifies when payments are due: 0 = end of period, 1 = beginning of period.<br>NaN will be returned if arguments are invalid or out of range.</td>
716+
</tr>
717+
<tr class="odd">
689718
<td style="text-align: left;">PV(Rate, Periods, Payment, [FutureValue], [Type])</td>
690719
<td style="text-align: left;">Returns the present value of an investment based on a constant interest rate, a fixed number of periods, and periodic payments.<br>Note that <em>FutureValue</em> and <em>Type</em> are optional and default to 0.<br>Also, <em>Type</em> specifies when payments are due: 0 = end of period, 1 = beginning of period.<br>NaN will be returned if <em>Periods</em> &lt;= 0 or if any required argument is not finite.</td>
691720
</tr>

docs/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
88

99
<meta name="author" content="Blake Madden">
10-
<meta name="dcterms.date" content="2026-01-09">
10+
<meta name="dcterms.date" content="2026-01-16">
1111

1212
<title>TinyExpr++</title>
1313
<style>
@@ -290,7 +290,7 @@ <h1 class="title">TinyExpr++</h1>
290290
<div>
291291
<div class="quarto-title-meta-heading">Published</div>
292292
<div class="quarto-title-meta-contents">
293-
<p class="date">January 9, 2026</p>
293+
<p class="date">January 16, 2026</p>
294294
</div>
295295
</div>
296296

docs/technical-overview.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,15 +298,15 @@ <h1 class="title"><span class="chapter-number">11</span>&nbsp; <span class="chap
298298
<p><code>te_parser::evaluate()</code> uses a simple recursive descent parser to compile your expression into a syntax tree. For example, the expression <code>"sin x + 1/4"</code> parses as:</p>
299299
<div class="cell">
300300
<div class="cell-output-display">
301-
<div class="grViz html-widget html-fill-item" id="htmlwidget-1e6a6c17d3ab866b9d2a" style="width:100%;height:480px;"></div>
302-
<script type="application/json" data-for="htmlwidget-1e6a6c17d3ab866b9d2a">{"x":{"diagram":"digraph {\n graph [layout = dot, rankdir = TB]\n \n node [shape = oval] \n node1 [label = \"+\"]\n node2 [label = \"sin\"]\n node3 [label = \"÷\", style=filled, fillcolor = \"#add8e6\"]\n node4 [label = \"x\"]\n node5 [label = \"1\", style=filled, fillcolor = \"#add8e6\"]\n node6 [label = \"4\", style=filled, fillcolor = \"#add8e6\"]\n \n # edge definitions with the node IDs\n node1 -> node2 -> node4\n node1 -> node3\n node3 -> node5\n node3 -> node6\n }","config":{"engine":"dot","options":null}},"evals":[],"jsHooks":[]}</script>
301+
<div class="grViz html-widget html-fill-item" id="htmlwidget-5d2d794c9980d0a90980" style="width:100%;height:480px;"></div>
302+
<script type="application/json" data-for="htmlwidget-5d2d794c9980d0a90980">{"x":{"diagram":"digraph {\n graph [layout = dot, rankdir = TB]\n \n node [shape = oval] \n node1 [label = \"+\"]\n node2 [label = \"sin\"]\n node3 [label = \"÷\", style=filled, fillcolor = \"#add8e6\"]\n node4 [label = \"x\"]\n node5 [label = \"1\", style=filled, fillcolor = \"#add8e6\"]\n node6 [label = \"4\", style=filled, fillcolor = \"#add8e6\"]\n \n # edge definitions with the node IDs\n node1 -> node2 -> node4\n node1 -> node3\n node3 -> node5\n node3 -> node6\n }","config":{"engine":"dot","options":null}},"evals":[],"jsHooks":[]}</script>
303303
</div>
304304
</div>
305305
<p><code>te_parser::evaluate()</code> also automatically prunes constant branches. In this example, the compiled expression returned by <code>compile()</code> would become:</p>
306306
<div class="cell">
307307
<div class="cell-output-display">
308-
<div class="grViz html-widget html-fill-item" id="htmlwidget-35809605711a92c72d63" style="width:100%;height:480px;"></div>
309-
<script type="application/json" data-for="htmlwidget-35809605711a92c72d63">{"x":{"diagram":"digraph {\n graph [layout = dot, rankdir = TB]\n \n node [shape = oval] \n node1 [label = \"+\"]\n node2 [label = \"sin\"]\n node3 [label = \"0.25\", style=filled, fillcolor = \"#add8e6\"]\n node4 [label = \"x\"]\n\n # edge definitions with the node IDs\n node1 -> node2 -> node4\n node1 -> node3\n }","config":{"engine":"dot","options":null}},"evals":[],"jsHooks":[]}</script>
308+
<div class="grViz html-widget html-fill-item" id="htmlwidget-e030c04f6658a9d543e3" style="width:100%;height:480px;"></div>
309+
<script type="application/json" data-for="htmlwidget-e030c04f6658a9d543e3">{"x":{"diagram":"digraph {\n graph [layout = dot, rankdir = TB]\n \n node [shape = oval] \n node1 [label = \"+\"]\n node2 [label = \"sin\"]\n node3 [label = \"0.25\", style=filled, fillcolor = \"#add8e6\"]\n node4 [label = \"x\"]\n\n # edge definitions with the node IDs\n node1 -> node2 -> node4\n node1 -> node3\n }","config":{"engine":"dot","options":null}},"evals":[],"jsHooks":[]}</script>
310310
</div>
311311
</div>
312312
<section id="grammar" class="level2 unnumbered">

tinyexpr.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@
7979
#include <type_traits>
8080

8181
constexpr int TINYEXPR_CPP_MAJOR_VERSION = 1;
82-
constexpr int TINYEXPR_CPP_MINOR_VERSION = 0;
83-
constexpr int TINYEXPR_CPP_PATCH_VERSION = 1;
84-
constexpr int TINYEXPR_CPP_TWEAK_VERSION = 1;
82+
constexpr int TINYEXPR_CPP_MINOR_VERSION = 1;
83+
constexpr int TINYEXPR_CPP_PATCH_VERSION = 0;
84+
constexpr int TINYEXPR_CPP_TWEAK_VERSION = 0;
8585
#define TINYEXPR_CPP_COPYRIGHT \
8686
"TinyExpr: Copyright (c) 2015-2020 Lewis Van Winkle\n" \
87-
"TinyExpr++: Copyright (c) 2020-2025 Blake Madden"
87+
"TinyExpr++: Copyright (c) 2020-2026 Blake Madden"
8888

8989
class te_parser;
9090

0 commit comments

Comments
 (0)