From: Mike Horvath
Subject: Shorthand for conditionals
Date: 19 Nov 2016 20:58:33
Message: <58310349$1@news.povray.org>
Can I make a feature request?
It might be nice to have shorthand conditional statements that take the
form of
#local r = r > 0.5 ? r - 0.055 : 12.92 * r;
Thanks.
Mike
From: clipka
Subject: Re: Shorthand for conditionals
Date: 19 Nov 2016 21:33:29
Message: <58310b79$1@news.povray.org>
Am 20.11.2016 um 02:58 schrieb Mike Horvath:
> Can I make a feature request?> > It might be nice to have shorthand conditional statements that take the> form of> > #local r = r > 0.5 ? r - 0.055 : 12.92 * r;
Such a conditional statement is already supported. For some strange
reason, such expressions have to be included in parentheses though:
#local r = (r > 0.5 ? r - 0.055 : 12.92 * r);
From: Mike Horvath
Subject: Re: Shorthand for conditionals
Date: 19 Nov 2016 23:30:15
Message: <583126d7$1@news.povray.org>
On 11/19/2016 9:33 PM, clipka wrote:
> Am 20.11.2016 um 02:58 schrieb Mike Horvath:>> Can I make a feature request?>>>> It might be nice to have shorthand conditional statements that take the>> form of>>>> #local r = r > 0.5 ? r - 0.055 : 12.92 * r;>> Such a conditional statement is already supported. For some strange> reason, such expressions have to be included in parentheses though:>> #local r = (r > 0.5 ? r - 0.055 : 12.92 * r);>
Okay. Weird. I was getting errors and this explains why.
Mike