POV-Ray : Newsgroups : povray.beta-test : v3.8b2. height_field input values at 0.0 not clean. : Re: v3.8b2. height_field input values at 0.0 not clean. Server Time
21 Apr 2024 08:08:41 EDT (-0400)
  Re: v3.8b2. height_field input values at 0.0 not clean.  
From: William F Pokorny
Date: 18 Feb 2023 05:40:25
Message: <63f0ab19$1@news.povray.org>
On 2/17/23 20:49, Tor Olav Kristensen wrote:
>> Aside: You can use the 3 term select depending upon a boolean result in
>> the first term test by doing something like:
>>
>> select(1-(2*((x<0.0) | (x>1.0))), 0, 1)
>> ...
> How about just this:
> 
> select(
>      -((x < 0.0) | (1.0 < x)),
>      0,
>      1
> )
> 
> - or this:
> 
> select(
>      -((0.0 <= x) & (x <= 1.0)),
>      1,
>      0
> )

:-)

Very likely OK in practice, and cleaner in form than my three term select.

What spooks me some is that -0 and +0 are real things in the IEEE 
floating point standard and as supported by C++. If a C++ coder has 
thought to test for -0 < 0, they can.

Bill P.


Post a reply to this message

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