<p dir="ltr">That's what disappointed my client (and me) Glynn: why integer yes and not 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.</p>
<p dir="ltr">Why do you that I'm confusing the operators? I've always talked about logical operators...</p>
<p dir="ltr">giovanni<br></p>
<p dir="ltr">Il 19/ott/2015 21:19, "Glynn Clements" <<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>> ha scritto:<br>
><br>
><br>
> G. Allegri wrote:<br>
><br>
> > Doing a logical operation with a DCELL raster within an if(x,a) statement<br>
> > produces an error: "Incorrect argument types to function bitand()".<br>
><br>
> First, you're confusing bitwise operators and logical operators. & and<br>
> | are bitwise operators, while && and || (and &&& and |||) are logical<br>
> operators.<br>
><br>
> Second, both bitwise and logical operators only work on integer<br>
> values. If you want to use floating-point values as boolean values,<br>
> you need to explicitly convert them to integers (either via int(x) or<br>
> round(x), or x==0.0, or abs(x)<1e-30, or whatever).<br>
><br>
> > This doesn't seem to be described inside the docs, is it?<br>
> ><br>
> > When the if() function is described it only states its behaviour in case of<br>
> > NULL, 0 or "otherwise" values.<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>
> --<br>
> Glynn Clements <<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>><br>
</p>