|
|
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
> William F Pokorny <ano### [at] anonymousorg> wrote:
> >...
> > I used the 4 term because I think it reads a little cleaner when setting
> > up a boolean test in the first term which can only return a zero or one
> > - the negative action is never used as Bill W said.
>
> I agree..
>
>
> > 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
> )
But for that check select() isn't needed.
This should be sufficient:
((0.0 <= x) & (x <= 1.0))
--
Tor Olav
http://subcube.com
https://github.com/t-o-k
Post a reply to this message
|
|