On Thursday, 21 May 2015 at 08:55:45 UTC, Saurabh Das wrote:
Thanks!

Wow, dustmite is really useful. It reduces the expression down to:

double someFunction(double AvgPriceChangeNormalized, double TicksTenMinutesNormalized)
{
return (TicksTenMinutesNormalized?1:AvgPriceChangeNormalized)?1:TicksTenMinutesNormalized/(TicksTenMinutesNormalized==0)==0;
}

Which gives a compiler error: Internal error: backend/cod1.c 1562

make that

double foo(double a, double b)
{
    return (b ? 1 : a) ? 1 : b / (b == 0) == 0;
}

and please submit to https://issues.dlang.org

That expression is, not to put too fine a point on it, mad. The operator precedence itself is giving me a headache, let alone the division of a double by a boolean... I'm pretty sure it doesn't do what you want it to, unless what you want is seriously weird.

As a matter of fact, i'm pretty sure that expression evaluates to 1, irrelevant of the values of the two variables.

Reply via email to