i have a formula, it is basically the result of two other previous calculations and it gives me an eror message saying that i cant use it as a function

ERRORC =  (( target1 ) - ( OUTC ) )(OUTC)(1 - OUTC);

target one is selected at the start.

if  ( pattern == 1 )
        {
            target1 = 1;
            target2 = 0;
         }

and outC is calculated

OUTC = 1/(1 + pow(e, -((WAC * OUTA) + (WBC * OUTB))));

e is 2.718281828
and the other variables have been set up earlier.

target1 and outc are set up as floats.

thanks in advance.

ERRORC = (( target1 ) - ( OUTC ) )(OUTC)(1 - OUTC); That statement contains mismatched parentheses. Count them and you will see that there are too many of them. You can't do multiplication with the (xxx)(yyy) syntax, meaning xxx times yyyy. You have to use the * operator if you intend to do multipliation, like this: ERRORC = (( target1 ) - ( OUTC ) ) * (OUTC) * (1 - OUTC);

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.