Ln function in macro

I have VBASupport enabled, and I have a line in my macro

lRoundedEMU = round(lEMU, iSF-1-cint(ln(abs(lEMU)/ln(10))))

Whenever I run it, I get:

BASIC runtime error.
‘35’
ln

So what gives? Why doesn’t it want to do a natural log?

lEMU and lRoundedEMU are longs. I tried switching to a doubles, and still no joy.

Because in BASIC the function returning the natural logarithm is called Log. See online help.

1 Like

Arg! I was looking here. That’s what I get for not making sure I was reading up on the right version.

It’s not a difference between versions, it’s a difference between Calc and BASIC.

Right you are! Thanks!