POV-Ray : Newsgroups : povray.unofficial.patches : Possible bug in Radiance HDR output code : Re: Possible bug in Radiance HDR output code Server Time
14 May 2024 16:45:29 EDT (-0400)
  Re: Possible bug in Radiance HDR output code  
From: Ray Gardener
Date: 4 Feb 2006 17:33:21
Message: <43e52bb1$1@news.povray.org>
Christoph Hormann wrote:
> Ray Gardener wrote:
>> Line 393 of module hdr.cpp rev 1.16, MegaPOV 1.2,
>> function void HDR_Image::Write_Line(COLOUR *line_data):
>>
>>    if (width < MINELEN | width > MAXELEN)
>>
>> The '|' symbol might need to be '||'.
>>
> 
> This making what difference for both arguments 0 or 1?
> 
> Note BTW that the original Radiance code does exactly the same.

It's actually a good example of code that might work most or all of the 
time, but it reduces readability because it's not a standard way to code 
a logical OR expression. The second version has parantheses around the 
inequality tests, so I suspect the original author ran into trouble and 
'fixed' that line by forcing the operator precedence, but '||' would 
have been the better choice.

Ray


Post a reply to this message

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