emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Giovanni Ridolfi <giovanni.ridolfi@yahoo.it>
To: Orgmode <emacs-orgmode@gnu.org>
Subject: [babel] calc var floating point number error
Date: Fri, 20 Jul 2012 14:55:53 +0100 (BST)	[thread overview]
Message-ID: <1342792553.1277.YahooMailNeo@web29802.mail.ird.yahoo.com> (raw)

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


cheers,
Giovanni


             reply	other threads:[~2012-07-20 13:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-20 13:55 Giovanni Ridolfi [this message]
2012-07-20 14:34 ` [babel] calc var floating point number error Eric Schulte
2012-07-25 15:32   ` Eric Schulte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1342792553.1277.YahooMailNeo@web29802.mail.ird.yahoo.com \
    --to=giovanni.ridolfi@yahoo.it \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).