Excel and VBA calculate the same formula differently
I have a strange phenomenon. In Excel the following expression: LN(8/PI()^2*280/125) equates to 0.596458. In VBA the code: Log(8/(4*Atn(1))^2*280/125 comes out to 0.554588, a difference of over 7%. I makes no difference to replace (4*Atn(1)) with 3.14, the difference is basically the same and it screws up my calculation. BTW, Log in VBA is the same as LN in Excel. Does somebody have an idea why this is and how to correct it? Thanks. Ottmar
|