Questions tagged [calc]
Calculator mode: Calculator major mode.
96
questions
0
votes
1
answer
50
views
Turn off the large parentheses
I ultimately got annoyed of Calc's new displaying of parentheses
Here it's vaguely tolerable (you may however notice the presence of artifacts), but for complicated expressions the various graphical ...
0
votes
1
answer
33
views
Emacs Calc IEEE 754 binary representation
Does Emacs Calc have IEEE 754 representation for binary numbers?
I found only "The Calculator’s arithmetic is not intended to be IEEE-conformant in any way", but I try maybe there is a ...
0
votes
2
answers
206
views
How to round on 2 decimals in org mode table using elisp?
That's probably a low hanging fruit.
In short, what I want:
6.7690001 ---> 6.77
I know how to do it in org mode table using regular TBLFM:
|---------|
|6.7690001|
|---------|
#+TBLFM: @1$1=@1$1;%....
0
votes
3
answers
47
views
Fewer keystrokes for calculating in org mode
When I need while editing a .org file to calculate, say, 23.45 * 15, I copy (M-w) that string then call M-x calc.
I paste the numbers as a string, preceded by a single tick (using algebraic mode so I ...
0
votes
0
answers
16
views
Rewrite rule changes order of expression
Let's say I have a rewrite rule
L(a + b) := L(a) + L(b)
when we apply this rule to rewrite L(x+y) the result is
L(y) + L(x)
but I would like it to give
L(x) + L(y),
i.e. to keep the same order of the ...
2
votes
0
answers
35
views
Working with units in emacs calc - unable to achieve expected result
I would like to calculate the following quantity:
sqrt{4kTR_S}
expressed in nV / sqrt{Hz}
(Incidentally, this site does not support math in the posts?)
In the above expression, k is Boltzmann's ...
1
vote
2
answers
65
views
GNU-Calc: How to change default multiplication symbol (\times) with (\cdot) in LaTeX language display mode
I'm trying out calc-embedded feature to write evaluate/manipulate equations in calc then write the output to my latex/org buffer.
In calc, one can change the display mode to LaTeX with d L (or calc-...
1
vote
1
answer
30
views
gnu-calc: How to declare variables in R (Real)?
I'm figuring out complex algebraic calculation in gnu-calc.
Suppose:
after many long calculation I got following algebraic expression:
-8 * a - 2 * b + 2 * b * i - 40 * i - 8
and I want the imaginary ...
1
vote
0
answers
23
views
using siunitx with calc latex-mode
I'm looking for a way to customize the LaTeX language mode in calc so that:3 m/s
gets displayed like
\SI{3}{\meter\per\second} instead of \frac{3 m}{s}. That would be very useful for yanking into a ...
1
vote
1
answer
79
views
Gnu CALC: vector/matrix concatenation in horizontal axis?
I'm just few days in learning about GNU-CALC. This is very awesome package.
Suppose I have 2 matrices (or column vector) with shape of 3x1:
2: [ [ a1 ]
[ a2 ]
[ a3 ] ]
1: [ [ b1 ]
[...
0
votes
2
answers
42
views
How to prevent digit loss in orgmode spreadsheets with elisp?
That's probably a low hanging fruit.
Assume an orgmode spreadsheet with one side for input - a number -
and the other side for output.
The other side is specified with simple elisp code,
taking the ...
2
votes
1
answer
44
views
Any yasnippet to evaluate infix math expression?
I would like to have a yasnippet to evaluate infix math expression on the current line. E.g., If the line is 1 + 2 = and I trigger yasnippet at the end of line, it will append the result at the end: ...
0
votes
1
answer
27
views
Solving set of equations with separate sides
In the calc, how can I solve set of equations where I have the two sides of the equations in separate stack entries? For example, the current stack looks like this:
2: [x, y, z]
1: [1, 2, 3]
(I ...
4
votes
3
answers
371
views
How can I use Emacs calc's "a R" (root) command to compute the inverse of the normal distribution function utpn?
Question
The Emacs Calc package info page for Probability Distribution Functions has this to say about the normal distribution function:
The ‘utpn(x,m,s)’ function uses a normal (Gaussian) ...
0
votes
0
answers
30
views
How can I use `utpt` in calc to compute a confidence interval?
I would like to use the "calc" package's utpt function to compute a confidence interval of a series of numbers in a calc vector.
Currently, I'm stuck at the very beginning, with a calc ...
0
votes
3
answers
80
views
How do I convert a `matrix` in one form to a `matrix` in another form (like `bmatrix` environment)
I'm attempting to take faster linear algebra notes within org-mode. The latex of a matrix is complex to write, so I'm trying to develop a shorthand expansion.
My current workflow is to highlight a ...
0
votes
3
answers
106
views
How to use table lookup functions results as input for calculations?
I have the following static table:
#+name: static
|-------+---------------+-----+--------|
| | Date of birth | Sex | Height |
|-------+---------------+-----+--------|
| Croce | <1985-07-30>...
0
votes
1
answer
32
views
calc: fill multiple adjacent rows with a formula?
With Table>Set Field>Formula, I'm able to do what I want for a particular field, in this case that corresponding to Aug 07. How can I fill multiple adjacent fields in one go, say Aug 7-15?
#+...
0
votes
1
answer
38
views
Is it possible to force calc to use the rules of ordinary algebraic calculus when the language is 'latex?
I mean : in a simple way..
(let ((calc-language 'latex))(calc-eval "1/2 + 1/4")) ; =>\frac{1}{12}
(let ((calc-language 'C))(calc-eval "1/2 + 1/4")) ; =>3/4
Of course, no ...
0
votes
2
answers
108
views
does emacs calc support matrix eigenvalue decompose?
I want to use emacs's calc to get the eigenvalue and eigenvector of a matrix.
I went to google but can't find anything about emacs and eigenvalue.
So, is calc support calculating eigenvalue or maybe ...
0
votes
1
answer
45
views
Emacs Calc: What's the meaning behind the name `calc-roll-down`?
In Emacs Calc I use <TAB> to swap the last two elements on the stack. The command for this is called calc-roll-down. What does "roll down" mean in this context?
When rolling the stack ...
2
votes
1
answer
79
views
Substitute a function in an algebraic expression
I have this algebraic expression
x L L
⌠ ⌠ ⌠ s
⎮ s*(L -...
0
votes
1
answer
40
views
sin() function in org-calc being weird?
Having read sin of pi radians, it seems as though sin is iffy around truncated inputs.
That said, I'm not quite grokking why it's this bad.
Given this org-mode table:
| i | $x_i$ | $sin(x^3)$ | ...
5
votes
1
answer
126
views
Why is the vsum of remote cells wrong in org tables?
I have some org-mode tables like this:
#+NAME: TableA
| Task | Amount |
|------+--------|
| Gna | 1 |
#+NAME: TableB
| Task | Amount |
|--------+--------|
| Gnampf | 3 |
| Overall | ...
1
vote
1
answer
53
views
How to recompute the last operation symbolically?
In symbolic mode I can type N to get the numerical value of the last expression: 2 Q pushes sqrt(2), at that point N pushes 1.414…. What's the quickest way to do the opposite? I.e., after having ...
0
votes
1
answer
50
views
How can I display the calc menu when `calc-embedded-mode` is enabled?
I find calc-embedded-mode handy for typing math from LaTeX mode. As I use it very little, I would like to have the calc menu in integrated mode. The menu remains in latex mode which is useless. I ...
0
votes
1
answer
72
views
LaTeX code output by Calc wrong
If I enable calc-embedded mode (C-x * e) in a LaTeX document (latex mode by default) when the point is in the math environment of the document below:
\documentclass{article}
\usepackage{amsmath}
\...
0
votes
1
answer
44
views
Populate table row with rate changes with one formula
I've got this Exhibit A in brute force for a rate that is halved after 10 minutes
#+NAME: ratetable
| 0 min | 10 min | 20 min | 30 min | 40 min | 50 min |
| 20.0 | 10. | 5. | 2.5 | 1.25 | ...
0
votes
0
answers
27
views
Issues when calling vcount in orgtbl
This is a minimal orgtbl example with no problem:
|---|
| a |
| b |
|---|
| 2 |
#+TBLFM: @>$1=vcount(@<..@>>)
But if I insert some particular chars (dot, comma, ...) the result or vcount ...
5
votes
2
answers
465
views
Complete a calculation ("2+3=...") inside a buffer
I have a calculation in my org-mode buffer:
7700*1/100 + 18000*2/100
I'm looking for the quicker way of completing it, and displaying it like this:
7700*1/100 + 18000*2/100 = 437
My current way of ...
5
votes
1
answer
423
views
I can't get the most basic calc-mode gnuplot example to work
I would like to graph functions and datasets from calc-mode. (That's a reasonable thing to do in 2021, right?)
Following the directions at Basic Graphics and Vectors as Lists, I started calc-mode, ...
1
vote
1
answer
92
views
How to fill in a formula into adjacent cells in org-mode spreadsheet?
For example, in the following table
|------------+------------+-----+-----+-----+-----+-----+-----+-----+-----|
| Pobability | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 |
| Odds ...
0
votes
2
answers
195
views
How to compute ln in Org-Mode spreadsheet
Is there a formula to compute the natural logarithm of a number in Org-Mode spreadsheet? For example, to compute ln(1), Excel or Calc formula is =ln(1), what would it be in Org-Mode?
The result should ...
1
vote
1
answer
121
views
In Emacs Calc, how do I find the distance between two points (x1,y1) and (x2,y2)?
I'm trying to calculate the euclidean distance between two points (x1,y1) and (x2,y2) which is
sqrt( (x2-x1)^2 + (y2-y1)^2 )
Is there a way to calculate this easily with Emacs calc?
(I looked in the ...
0
votes
0
answers
150
views
How can I use calc to convert in orgmode table
I am trying to use calc convert in an org mode table.
The gnu manual suggests
$c/$1/$cm
So in my table I tried (for column formula
=$c/$1/$cm also tried =$1/$c/$cm, =$1/$m/$cm etc
Which produces #...
0
votes
3
answers
261
views
org mode sum time from remote table with org-lookup-all
I have two tables
#+NAME: tasks
| name | spent |
|--------+--------|
| task 1 | |
| task 2 | |
| task 3 | |
| task 4 | |
| task 5 | |
#+NAME: works
| date ...
5
votes
2
answers
149
views
How does if() work in org spreadsheets?
I got the impression from the manual that
| a | |
| b | |
#+TBLFM: $2=if($-1==a, 1, 0)
should produce "1" in the first row and "0" in the second. But
instead I ...
3
votes
1
answer
546
views
Table formulas involving percentages
I'm creating a table with percentages and calculating a simple sum of a column. The only thing left is to show the result of the formula as a percentage.
Here is my MWE:
| Element | $ |
| E1 | ...
1
vote
1
answer
108
views
Row descriptor -X leads outside table
I'm trying to calculate a new column on an org table, I'm using the following table formula:
#+TBLFM: $9=if (@# > 15, ($6-@-14$6)*100000/10724599, 0)
It's taking the difference on column 6 between ...
2
votes
1
answer
1k
views
Specify precision using calc in org mode spreadsheets
According to the org mode documentation for calc syntax you can append printf formatters to specify the number of decimal places to display ‘$1+$2;%.2f’ Same, format result to two decimals. Is there a ...
1
vote
1
answer
132
views
Is there a row-reduced echelon form for calc mode?
If i have the matrix
[ [1, 3, -1, -1],
[1, 5, -1, -4],
[-3, 6, 2, 11] ]
is there some RREF routine built in calc?
Note, i don't want to write out of the equation with variables x,y,z and then use ...
0
votes
1
answer
83
views
How to make quick-calc output a result rounded with just 1 digit precision—1/7 = 0.1, not 0.142857142857?
The title basically already says it all. Just one addition. I need quick-calc to act like that for just 2 times a week. Usually I prefer the standard 12 digit precision.
I know how to achieve this ...
1
vote
1
answer
26
views
Non integer powers of 10 in algebraic mode in calc
How should one type numbers like 10^(-2.5) using the 1e... notation in calc using algebraic-mode ? ATM, 1e-2.5 is parsed as (1e-2)*0.5 and indeed evaluates to 5e-3 instead of 3.16e-3.
0
votes
4
answers
469
views
org-mode spreadsheet multiply 2 columns element-wise using GNU Emacs Calc formula
I am looking for a way to multiply 2 columns element by element and then sum the resulting vector. I have the following example:
| | | col1 | enable |
|---+-------+------+--------|
| | ...
4
votes
1
answer
128
views
how to do simple calculations on numbers in text
I have a Json file containing a quite a few coordinates like {x: 400, y:200}
And I want to change the numbers for the y values in something like y:y_default + 120. (y_default = 80). Is there a quick ...
1
vote
0
answers
879
views
Time-formatted output from org-table date- and time calculation?
I have an org-table for my timesheets. Part of it looks this:
| Start | End | End - Start |
| <2020-03-05 10:00> | <2020-03-05 Thu 14:30> | 0.1875 |
#+...
3
votes
1
answer
195
views
Define a function in Calc (Embedded)
In Calc Embedded Mode, you can define a variable with the := operator. You can then use it in an equation using the => operator and it will be automatically updated when you change the variable. ...
3
votes
2
answers
429
views
How can I sum (multiply ...) all elements on the calc stack?
Sometimes I just want to sum a bunch of numbers in calc. Right now I press + until the stack is empty. Is there a shorthand for this?
1
vote
2
answers
249
views
Evaluate algebraic formula in the buffer in place
Is there some package or builtin emacs feature which evaluates an algebraic formula in place?
E.g. I type in the scratch buffer:
(3 + 4) * 5
and when I invoke some command on this line then I ...
2
votes
1
answer
193
views
org-table to calc matrix and back again?
Is it possible to feed data from an org table into calc as a matrix, and then get it out again as a vector to fill in a column?
For example, if I have:
| | Fund A | Fund B | Fund C | ...