|
 |
"ingo" <nomail@nomail> wrote:
> The following line results in an negative subscript error when Z = 0:
>
> #if (Z > 0 & VoxelGrid[X][Y][Z-1] > 0)
>
> I expected the evaluation to terminate, with false, at Z > 0.
>
> Won't say it is a bug, it is just unexpected.
Hi Ingo
There's some relevant information here:
https://en.wikipedia.org/wiki/Short-circuit_evaluation
In order to program in a more robust and portable way, one should avoid such
constructs that may differ between languages.
I suggest that you split this up into nested #if statements.
--
Tor Olav
http://subcube.com
https://github.com/t-o-k
Post a reply to this message
|
 |