POV-Ray : Newsgroups : povray.advanced-users : It gets even weirder. : Re: It gets even weirder. Server Time
16 Apr 2024 15:31:17 EDT (-0400)
  Re: It gets even weirder.  
From: clipka
Date: 27 Aug 2018 05:33:38
Message: <5b83c572$1@news.povray.org>
Am 27.08.2018 um 03:05 schrieb Bald Eagle:
> I broke POV-Ray.
> Stephen, I'm pouring Scotch in my coffee...   :|

I'm warning against this workaround, as it only exacerbates the
underlying root cause ;)

> // Run this as-is, and U goes to 11, and V goes to 35
> // NOW
> // change The line below to Usize+1, and U goes to 11, and V goes to 36 !!!  :O
> // How can a variable NOT USED in defining the range of a #for loop change the
> behaviour of the loop!
> //  In BOTH variables!
> //  Usize is never redefined!   W   T   H


Don't be fooled: The /first/ loop with debug output (recognizable by
printing 3 decimals) /always/ goes to 13 and 36, respectively.

Or rather, it would if it could.

The second loop with debug output (recognizable by printing no decimals)
would always go to 11 and 35, respectively.

The difference is that depending on whether `USize+2` or `USize+1` is
used in the array declaration, POV-Ray may run into an
array-out-of-bounds error when U reaches 13 in the first loop, and never
even start the second loop.

Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.