summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/plib/pfunction.h
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2020-07-02 21:29:25 +0200
committer couriersud <couriersud@gmx.org>2020-07-02 21:29:25 +0200
commitfb90cac2f2079972d75b3c4637de314a8498ed24 (patch)
tree4b89b545712e513bcebbfe3c995dc914a104637f /src/lib/netlist/plib/pfunction.h
parentfd268c1202b3634c53ab1088026a925fb5134abb (diff)
netlist: Add comparison operators to pfunction.
Comparison operators evaluate either into 0.0 or 1.0. Thus they can be used like "(a==1)*(b==2)" which will only result in 1.0 if a equal 1 and b equal 1. From the yet to be released test code: * PFUNCEXPECT("1==1", 1.0) * PFUNCEXPECT("1 *0 == 2-1-1", 1.0) * PFUNCEXPECT("0!=1", 1.0) * PFUNCEXPECT("0<1", 1.0) * PFUNCEXPECT("1>0", 1.0) * PFUNCEXPECT("0<=1", 1.0) * PFUNCEXPECT("1>=0", 1.0) * PFUNCEXPECT("1<=1", 1.0) * PFUNCEXPECT("1>=1", 1.0) * PFUNCEXPECT("if(1>0, 2, 0)", 2.0) * PFUNCEXPECT("if(0>1, 2, 3)", 3.0) * PFUNCEXPECT("if(sin(1)>0, 2, 3)", 3.0) // fail
Diffstat (limited to 'src/lib/netlist/plib/pfunction.h')
-rw-r--r--src/lib/netlist/plib/pfunction.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/netlist/plib/pfunction.h b/src/lib/netlist/plib/pfunction.h
index e0b81a25e00..fe5a5dd1dc6 100644
--- a/src/lib/netlist/plib/pfunction.h
+++ b/src/lib/netlist/plib/pfunction.h
@@ -32,6 +32,13 @@ namespace plib {
MULT,
SUB,
DIV,
+ EQ,
+ NE,
+ LT,
+ GT,
+ LE,
+ GE,
+ IF,
POW,
SIN,
COS,