Yes indeedy ...
You've declared all the variables as Long. This is integer, so you've lost
all the floating point parts.
"ct" and "sigfig" should be declared as Integer. All the rest should be
declared as Double.
Having done that, I get 10.
Note also, that the original has the statement "apo=Math.sqrt(apo);" in it,
and you didn't transcribe that to VBA. It doesn't appear to be used in
calculation of the two results you're using, but it does affect the JS's
ans[6].