<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:jiri@boha.cz" title="Jiří Boháč <jiri@boha.cz>"> <span class="fn">Jiří Boháč</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - the current() function is confused if used inside or()"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=121105">bug 121105</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>NOTABUG
           </td>
           <td>---
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>RESOLVED
           </td>
           <td>REOPENED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - the current() function is confused if used inside or()"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=121105#c9">Comment # 9</a>
              on <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - the current() function is confused if used inside or()"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=121105">bug 121105</a>
              from <span class="vcard"><a class="email" href="mailto:jiri@boha.cz" title="Jiří Boháč <jiri@boha.cz>"> <span class="fn">Jiří Boháč</span></a>
</span></b>
        <pre>(In reply to m.a.riosv from <a href="show_bug.cgi?id=121105#c8">comment #8</a>)
<span class="quote">> =5+OR(3;CURRENT())=6
> =5+OR(1;1)=5+1=6</span >

this is correct

<span class="quote">> =5+OR(0;CURRENT())=5
> =5+OR(0;0)=5+0=5</span >

yes, this is the bug. There cannot be any sane explanation for this:

=5+OR(0;CURRENT()) = 5
=5+OR(CURRENT(),0) = 6

<span class="quote">> CURRENT() takes the value inside the function, what looks fine at that step,
> until the calculation of the function is finished.</span >

Seem CURRENT() in fact returns the value of the first function argument:

=5+POWER(3,CURRENT()) = 5+3^3 = 5+27 = 32
=5+POWER(CURRENT(), 3) = 5 + 5^3  = 130

Parentheses also totally screw it up:

=5+POWER((CURRENT()+1), 3) = 5+(5+1)^3 = 221 (correct)
=5+POWER((1+CURRENT()), 3) = 5+(1+1)^3 = 13 (WTF!)</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>