|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi,
in sunpos.inc, I find several statements of this form:
|#if (0<M<360)
| ...
|#end
I can remember, that -- many years ago -- I read somewhere about this
'(value1 < variable < value2)' construct. But I cannot recall, what the
construct does.
In the POV-Ray documentation, I could not find an explanation of this
construct. If it is there, the explanation seems to be hidden very
thoroughly. :)
Could anyone please tell me, what '(0<M<360)' does?
Many thanks in advance,
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Could anyone please tell me, what '(0<M<360)' does?
I actually don't remember if the < operator has a left-to-right or
a right-to-left precedence, but in any case it means either:
- Calculate the "0<M" comparison, returning 0 or 1, and then compare
that result to 360, which always gives true, or
- Calculate the "M<360" comparison, returning 0 or 1, and then compare
that result to 0, which means that the expression is completely
equivalent to #if(M<360) (ie. the "0<" part does nothing)
In any case, it's a clear programming mistake. What the author probably
wanted to do is:
#if (0<M & M<360)
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp <war### [at] tagpovrayorg> wrote:
> In any case, it's a clear programming mistake. What the author probably
>wanted to do is:
>
>#if (0<M & M<360)
That was also one of my ideas. But -- maybe I'm wrong -- I have a faint
memory of having read about such a construct a long time ago. Perhaps it
was in a different context, not related to POV-Ray.
Thanks,
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> That was also one of my ideas. But -- maybe I'm wrong -- I have a faint
> memory of having read about such a construct a long time ago. Perhaps it
> was in a different context, not related to POV-Ray.
Not related to POV-Ray.
The closest thing POV-Ray has is the #range keyword (which is only
usable in #switch blocks, though).
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |