Giovanni Ridolfi writes: > Hello everyone, > > GNU Emacs 24.1.1 (i386-mingw-nt6.1.7601) of 2012-06-10 on MARVIN > Org-mode version 7.8.11 (eed478ffa @ > > > I have a problem with babel and calc. > > I am not able to pass (as variable) floating point numbers.  > > this example works: > > #+BEGIN_SRC calc :var thi=20 :var tha=90 :var a=10 :var rho=7854 :var cp=434 :var r=5 > ?tha -? (tha - thi) * exp((-3.0*a)/(rho*cp*r)) > #+END_SRC > > #+RESULTS: > : 20.0001232163 > > > However var "r" should be 0.05, but if I use such floating point number I got an error: > > > #+NAME sphere > #+BEGIN_SRC calc :var thi=20 :var tha=90 :var a=10 :var rho=7854 :var cp=434 :var r=0.05 > ?tha -? (tha - thi) * exp((-3.0*a)/(rho*cp*r)) > #+END_SRC > > #+RESULTS: > | 19 | Expected a number | > > This behaviour has been reported also in SO > > http://stackoverflow.com/questions/9559221/simple-math-results-in-an-emacs-org-mode-file-with-babel > The calc internals are truly perplexing. In fact, passing floating point numbers does work as long as division is preformed (see below). When division and floating point numbers are both present, calc inserts a ' into its internal representation. Striping this quote out manually allows the calculation to proceed. The attached patch does this stripping, resulting the in the change of behavior shown below. I suspect that the ' is inserted for some valid reason, so I wouldn't recommend actually applying this patch to Org-mode unless/until someone who is familiar with calc can review it. Here are some calc blocks before and after the patch.