emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] How to use Calc constants in an Org table?


From: Eric Abrahamsen
Subject: Re: [O] How to use Calc constants in an Org table?
Date: Fri, 06 Feb 2015 08:47:21 +0800
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

Marcin Borkowski <address@hidden> 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..@>address@hidden::@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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]