# Invalid Parenthensis in Formula

#### MM2forever

##### Active Member
Hi guys,
can you tell me what gives the invalid parenthensis with this formula?:

(234.67*0.434292289*Ln(6.1*exp((7.45*temp.Value)/(234.67+temp.Value)*
2.3025851)*lf.Value/100/6.1))/(7.45-0.434292289*Ln(6.1*exp((7.45*
temp.Value)/(234.67+temp.Value)*2.3025851)*lf.Value/100/6.1))
is it the Ln function which recieves a value higher than a Double or just some wrong brackets?

#### dzt

##### Active Member
B4X:
``````(234.67*0.434292289*Ln(6.1*exp((7.45*temp.Value)/(234.67+temp.Value)*
2.3025851)*lf.Value/100/6.1))/(7.45-0.434292289*Ln(6.1*exp((7.45*
temp.Value)/(234.67+temp.Value)*2.3025851)*lf.Value/100/6.1))`````` :sign0085::sign0148:

Why don't you try to brake it in smaller parts?

#### specci48

##### Well-Known Member
Hi MM2forever,

there is no function exp() provided by basic4ppc. Is this a custon function implemented by you?

specci48

#### klaus

##### Expert
I suppose the exp(x) means e at the power of x.
Exp is NOT a keyword in B4PPC.
You must replace it with:
cE^(x) this works.

In the IDE Keywords are dispayed in blue, exp is in black so not a keyword.

Best regards

#### MM2forever

##### Active Member
uppsss...

I thought replaced all exp's, but i forgot some as you see.
(it used to be an excel formula)

I've corrected it to this:

(234.67*0.434292289*Ln(6.1*cE^(7.45*temp.Value)/(234.67+temp.Value)*
2.3025851)* lf.Value/100/6.1))/(7.45-0.434292289*Ln(6.1*(cE^(7.45*
temp.Value)/(234.67+temp.Value)*2.3025851)*lf.Value/100/6.1))

but it still gives me the same error #### Erel

Staff member
You should remove the bold parenthesis:
(234.67*0.434292289*Ln(6.1*cE^(7.45*temp.Value)/(234.67+temp.Value)*
2.3025851)* lf.Value/100/6.1))/(7.45-0.434292289*Ln(6.1*(cE^(7.45*
temp.Value)/(234.67+temp.Value)*2.3025851)*lf.Value/100/6.1))

#### MM2forever

##### Active Member

I've eased and split up the formula to this:

SDD=6.1078*10^((a*temp.Value)/(b+temp.Value))
DD=lf.Value/100*SDD
v=Log(DD/6.1078)
TD=b*v/(a-v)

(TD is the result)

now it works!

BTW: this formula calculates the 'dew point' from the given temperature and rel. humidity