user4137: In the validator, I have defined:
txInfo :: TxInfo
txInfo = scriptContextTxInfo ctx

feePaid :: Integer
feePaid = Ada.getLovelace (Ada.fromValue (txInfoFee txInfo))

the strange thing is, when I do:
traceIfFalse "fee test" (feePaid >= 0)

, it evaluates to True, but
traceIfFalse "fee test" (feePaid == 0)

and
traceIfFalse "fee test" (feePaid > 0)

evaluates to False! How is this possible? Am I doing something wrong?
The very same thing happens when using Plutus.V1.Ledger.Contexts functions.
For example valueProduced (of ADA, using valueOf, so getting Integer) - valueSpent (same, Integer) equates to true if using >= or <= operator, but is neither >, < or ==.
Evaluating using Emulator Trace.
valueProduced, valueSpent example:
test :: TxInfo -> Order -> Integer
test info ord = subtractInteger (valueOf (valueProduced info) (quoteAssetSymbol ord) (quoteAssetName ord)) (valueOf (valueSpent info) (quoteAssetSymbol ord) (quoteAssetName ord))

Order has quoteAssetSymbol which is of type CurrencySymbol and is ADA (""), quoteAssetSymbol is of type TokenName, and is also ADA ("").
Tried using greaterThanEqualsInteger, equalsInteger, etc.. Same result

user5085: I think you're not using the correct comparison operators. Make sure you import PlutusTx.Prelude and use == function from there, like described here:
https://cardano.stackexchange.com/a/8323/5085

4137: <p>In the validator, I have defined:</p>
<pre><code>txInfo :: TxInfo
txInfo = scriptContextTxInfo ctx

feePaid :: Integer
feePaid = Ada.getLovelace (Ada.fromValue (txInfoFee txInfo))
</code></pre>
<p>the strange thing is, when I do:</p>
<pre><code>traceIfFalse &quot;fee test&quot; (feePaid &gt;= 0)
</code></pre>
<p>, it evaluates to True, but</p>
<pre><code>traceIfFalse &quot;fee test&quot; (feePaid == 0)
</code></pre>
<p>and</p>
<pre><code>traceIfFalse &quot;fee test&quot; (feePaid &gt; 0)
</code></pre>
<p>evaluates to False! How is this possible? Am I doing something wrong?</p>
<p>The very same thing happens when using Plutus.V1.Ledger.Contexts functions.</p>
<p>For example valueProduced (of ADA, using valueOf, so getting Integer) - valueSpent (same, Integer) equates to true if using &gt;= or &lt;= operator, but is neither &gt;, &lt; or ==.</p>
<p>Evaluating using Emulator Trace.</p>
<p>valueProduced, valueSpent example:</p>
<pre><code>test :: TxInfo -&gt; Order -&gt; Integer
test info ord = subtractInteger (valueOf (valueProduced info) (quoteAssetSymbol ord) (quoteAssetName ord)) (valueOf (valueSpent info) (quoteAssetSymbol ord) (quoteAssetName ord))
</code></pre>
<p>Order has quoteAssetSymbol which is of type CurrencySymbol and is ADA (&quot;&quot;), quoteAssetSymbol is of type TokenName, and is also ADA (&quot;&quot;).</p>
<p>Tried using greaterThanEqualsInteger, equalsInteger, etc.. Same result</p>
 5085: <p>I think you're not using the correct comparison operators. Make sure you import <code>PlutusTx.Prelude</code> and use <code>==</code> function from there, like described here:</p>
<p><a href="https://cardano.stackexchange.com/a/8323/5085">https://cardano.stackexchange.com/a/8323/5085</a></p>
