Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what is wrong below??

Status
Not open for further replies.

rzrdigo

Programmer
Jan 7, 2011
19
BR
Error: Incompatible type conversion

Z=((sqrt(Alfa23_linha)*Tetaliq*Rms*exp(-Alfa23_linha*Fi3*Fi3))/(ERF(sqrt(Alfa23_linha)*Fi3)-ERF(sqrt(Alfa23_linha)*Fi2))+(sqrt(Beta23)*Rls*Tetai*exp(-Beta23*Fi3*Fi3))/(ERFC(sqrt(Beta23)*Fi3))-(sqrt(3.14)*Fi3*Fliq)/(St));

OBS: everything is double


Error: Function Call missing )

W=((Tetae*exp(-Fi2*Fi2)/ERF(Fi2))-(sqrt(Alfa23_linha)*Rms*Tetaliq*exp(-Alfa23_linha*Fi2*Fi2)/(ERF(sqrt(Alfa23_linha)*Fi3)-ERF(sqrt(Alfa23_linha)Fi2)))-(sqrt(pi)*Fi2*(1-Fseq)/St));

I already tried switching all ways of parenthesis, does anybody see whats wrong?
 
Try breaking down the formula into smaller steps; This will give a clearer picture of where the problem lies. It is extremely difficult to see where the problem lies with operations this long. I would be willing to bet though, that you left out a multiplication operator (as it would be written on paper), so the compiler thinks you are trying to typecast to an undeclared type.

//What we want
A = B*(C+D)

// What we typed
A = B(C+D)
// this is actually an attempt to typecast the result of C+D to type B, which does not exist

On the 2d, just make sure you match opening parentheses with closing Parentheses. I usually move the cursor through the line of code and count the each opening Parentheses, and decrementing my count for each closing parentheses. Doing this, you should be back to zero when you reache the last Closing ")".
 
Exactly.
Missed * in ...ERF(sqrt(Alfa23_linha)Fi2)...
Probably the parser terminates ERF call on Fi2 and reports missed call error (no closing parenthesis).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top