POV-Ray : Newsgroups : povray.newusers : What does '#if (0<M<360)' mean? : Re: What does '#if (0<M<360)' mean? Server Time
29 Jul 2024 02:23:07 EDT (-0400)
  Re: What does '#if (0<M<360)' mean?  
From: Warp
Date: 4 Feb 2007 03:52:31
Message: <45c59ecf@news.povray.org>

> 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

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