From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: How to use Calc constants in an Org table? Date: Fri, 06 Feb 2015 08:47:21 +0800 Message-ID: <87bnl7dfxi.fsf@ericabrahamsen.net> References: <8761bgoba1.fsf@wmi.amu.edu.pl> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57428) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJX55-0006Ga-Vs for emacs-orgmode@gnu.org; Thu, 05 Feb 2015 19:47:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJX52-0002cJ-0e for emacs-orgmode@gnu.org; Thu, 05 Feb 2015 19:47:35 -0500 Received: from plane.gmane.org ([80.91.229.3]:34538) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJX51-0002br-QJ for emacs-orgmode@gnu.org; Thu, 05 Feb 2015 19:47:31 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YJX4z-0006J5-2d for emacs-orgmode@gnu.org; Fri, 06 Feb 2015 01:47:29 +0100 Received: from 114.248.11.172 ([114.248.11.172]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 06 Feb 2015 01:47:29 +0100 Received: from eric by 114.248.11.172 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 06 Feb 2015 01:47:29 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Marcin Borkowski writes: > Hello Orgers, > > I'd like Org to compute Fibonacci numbers for me (using a simplified > Binet formula, i.e., Fib(n)=round(phi^n)/sqrt(5)). Here's my > (unsuccessful) attempt: > > | n | Fib(n) | > |---+--------------------------| > | 1 | round(phi / 2.2360680) | > | 2 | round(phi^2 / 2.2360680) | > | 3 | round(phi^3 / 2.2360680) | > | 4 | round(phi^4 / 2.2360680) | > | 5 | round(phi^5 / 2.2360680) | > | 6 | round(phi^6 / 2.2360680) | > | 7 | round(phi^7 / 2.2360680) | > | 8 | round(phi^8 / 2.2360680) | > > #+TBLFM: @3$1..@>$1=1+@-1::@2$2..@>$2=round(phi^$1/sqrt(5)) > > I tried adding the line > > #+CONSTANTS: phi=1.61803398875 > to the file (and C-c C-c'd on it), but to no avail. > > What am I doing wrong? References to constants need to be prefixed with a "$". So replacing the "phi" with "$phi" in the table formula should do what you want. Eric