emacs-orgmode
[Top][All Lists]
Advanced

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

Re: LIterate programming with calc (help)


From: Ypo
Subject: Re: LIterate programming with calc (help)
Date: Mon, 24 Oct 2022 13:26:58 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

Not bad, thanks!!!

Why do you think it doesn't work something more human readable like this?

#+begin_src calc
               solve([
               a = 300 m,
               b = 300 m,
               Area = a*b,
               cost = 1 (USD/m^2),
               z = Area*cost

               ], [a, b, Area, cost, z])
#+end_src


Best regards


El 24/10/2022 a las 9:56, Fraga, Eric escribió:
On Sunday, 23 Oct 2022 at 14:15, Ypo wrote:
Is it possible to express in a calc block some basic operations with
variables and non-predefined units?
Why A*c won't show an arithmetic result, but ~: A c ~?
I've never managed to get calc blocks define variables.  The equations
you have typed in are "equations" in the mathematical sense, not
assignment statements.

Is it possible to work with the "$" unit?
$ means something specific in calc (cannot remember what).  I use "USD"
instead, for instance, and it works fine.

The following single line calc block does do what you want:

#+begin_src calc
  solve([a = 300 m, b = 300 m, Area = a*b, cost = 1 (USD/m^2), z = Area*cost], [a, b, Area, cost, z])
#+end_src

#+results:
: [a = 300 m, b = 300 m, Area = 90000 m^2, cost = USD / m^2, z = 90000 USD]


reply via email to

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