|
|
Le 2023-03-28 à 14:06, Bald Eagle a écrit :
> "Bald Eagle" <cre### [at] netscapenet> wrote:
>
>> But perhaps have to figure out how to mimic a python yield directive in SDL -
>> maybe TOK has some ideas on that.
>
> I got the yield worked out, now I am trying to properly decipher these
> expressions:
>
> //#local ta = (a - int(da <= 0) - fa) / da if da != 0 else float('inf');
int(da<=0) evaluate to 1 whenever da is zero or negative, and 0 if da is
positive. The «int» does nothing as the <= operation returns ONLY 1 or 0.
As the else invert the result of the test,
«if da != 0 else» is the same as «if da = 0» of «if !da».
//#local ta = (a - da <=0 - fa) / da if !da float ('inf');
>
> //#local ida = abs(1 / da) if da != 0 else float('inf');
//#local ida = abs(1 / da) if !da float('inf');
>
>
>
Post a reply to this message
|
|