<p dir="ltr">Ah ok Glynn, I always meant logical operators. Probably I copied the error from a different test.</p>
<p dir="ltr">If logical operator is applied to, sat, Byte data it gives true/false results, e.g. if(A && B,1, 0) behaves correctly even with cell values values greater then 1.<br>
That's why I expected it to work with floats operands too. <br>
>From a user perspective if it works for a cell with value 2 it should also work for a cell with value 2.0. <br>
That'all.</p>
<p dir="ltr">giovanni</p>
<div class="gmail_quote">Il 22/ott/2015 02:44, "Glynn Clements" <<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>> ha scritto:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
G. Allegri wrote:<br>
<br>
> > This isn't about the if() function. The bitand() function (to which<br>
> > the error message refers) corresponds to the bitwise-and operator "&".<br>
> ><br>
> > The if() function accepts either integer or floating-point values for<br>
> > its arguments.<br>
><br>
> That's what disappointed my client (and me) Glynn: why integer yes and not<br>
> floats? Is it a technical limitation or there's a ratio behind it?<br>
> Anyway did I miss something from the docs? I couldn't find it.<br>
<br>
What would you expect the value of (x & y) to be if x and/or y were<br>
floating-point values?<br>
<br>
> Why do you that I'm confusing the operators? I've always talked about<br>
> logical operators...<br>
<br>
Because you quote an error message which specifically refers to a<br>
*bitwise* operator:<br>
<br>
> "Incorrect argument types to function bitand()".<br>
<br>
in a message which otherwise only mentions logical operators.<br>
<br>
"bitand()" is the name of the bitwise-and function, which corresponds to<br>
the infix "&" operator. I.e. (x & y) is exactly equivalent to bitand(x, y).<br>
<br>
This is the same as the "&" operator in C or C++: it evaluates to an<br>
integer where each bit in the result is set (one) if the corresponding<br>
bit is set in both operands, and unset (zero) otherwise. E.g. (23 & 34)<br>
is<br>
00010111 (23)<br>
& 00100010 (34)<br>
--------<br>
= 00000010 ( 2)<br>
<br>
Perhaps it would help if you posted the exact expression which is<br>
causing you problems.<br>
<br>
--<br>
Glynn Clements <<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>><br>
</blockquote></div>