Log() not Returning what is Expected

Hello,

I am doing a simple log( c / ref(c,-1) ) calculation, but I am not getting the value that I expect. The calculation is ln( 90.2578 / 90.2353) which is returning 0.000249355 instead of 0.000249317. I checked in the quote editor to make sure there was rounding that I was missing, but I verified on a calculator and in Excel that the value is wrong. What is happening here?

@TX_trader,

Tomasz discussed this earlier, please refer:

And in manual:

Also this MS Excel doc:

Please feel free to share what you understood!

1 Like

i still have an ancient version of IDL (interactive data language). This is what I get:

IDL> print,alog( 90.2578 / 90.2353)
  0.000249355
3 Likes

Nothing is “hapenning” except the fact that you don’t understand how floating point works and that actually both numbers are correct. First is 32 bit the other one is 64 bit.

1 Like

That's for sure. Thanks for the clarification.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.