Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [calc]

Calculator mode: Calculator major mode.

1
vote
1answer
21 views

Problems using ^ in calc

I'm using calc on OSX and on a spanish keyboard, and I see some problems in using ^, but this is the most annoying: when I type this example from de calc tutorial 1: 2 2: 2 1: 8 ...
1
vote
1answer
45 views

Org table: Calculate units

Are Org tables able to calcultate units? Say I have a table | test | Voltage | DC | Current | Power | |----------+----------+-----+------------+-------------| | DC-motor | 12 V | ...
0
votes
1answer
60 views

Why is calc-precision function definition void?

For a school assignment, we were to find some way to overcome Elisp's limited floating point precision. I found this, which I thought was pretty useful, but it gives no description of how to actually ...
1
vote
1answer
46 views

How to add a time and a time interval in calc-mode?

How do I use calc to add a time interval to a moment in time (i.e., a date, or a time)? For instance, say I want to know what the time and day will be 8,000 minutes into the future? I know that t N ...
2
votes
0answers
53 views

Setting org-babel-load-languages in .dir-locals.el

As per the title, I'd like to set the org-babel-load-languages (to contain ditaa and calc languages) for a specific project only. The only solution I found so far is this one ( (org-mode . ...
0
votes
1answer
27 views

Creating a macro/elisp function for HASH using calc

In my workflow, I need to do binary operations quite often. I am wondering if there is a clean way of creating macro/elisp-function to return value of following HASH function. Input 16bit hex number: ...
2
votes
1answer
36 views

calc splits wrong window.

I have a problem with using calc. When I have two windows open in emacs, split vertically, calc frequently opens in the wrong window. Here's a demonstration of the problem that I ran with emacs -Q. ...
0
votes
0answers
18 views

Horizontally stack two Nx1 matrices

In Calc I have two bidimensional, Nx1 matrices ' [1 2 3] RET v t RET if I use the | command I get a 2Nx1 matrix (let's say a vertical stack) and of course i could ' [1 2 3] RET RET | vt to get ...
1
vote
0answers
48 views

How do I interconvert Calc's HMS forms and seconds?

Is there a built-in way to convert/toggle between GNU Emacs Calc's HMS forms and seconds? I'd also like to easily be able to add numbers as seconds and/or minutes to an existing HMS form.
6
votes
1answer
60 views

How to group digits in minibuffer when sending input to calc?

Is it possible to send something like 200*100,000 as an input to calc? Documentation says Long numbers can be hard to read if they have too many digits. Press d g (calc-group-digits) to enable ...
5
votes
2answers
314 views

Quickly Evaluate Infix Math Expression?

Is there a way to highlight and quickly evaluate a simple math expression without using elisp notation? For example, we can already evaluate the elisp expression (+ 1 1) in the following text snippet ...
1
vote
1answer
48 views

evaluation of calc formulas in orgtbl?

in calc mode, 'subst (2 * x, x, 5)' is evaluated to 10, but in an orgtbl table the formula is evaluated incompletely to '2 5'. How to force evaluation into orgtbl-mode? Here is my example: |-----+----...
1
vote
1answer
41 views

Absolute value of complex numbers in Calc?

If I do this in Calc mode: ' 7i-2 It will enter the symbolic algebraic term 7i - 2, which is displayed like so: --- Emacs Calculator Mode --- 1: 7 i - 2 . However, if I run A (calc-abs), I ...
3
votes
2answers
65 views

Closing emacsclient after quitting calc?

I'd like to run calc in an emacsclient in my terminal, and then have that particular emacsclient session close completely and return me to my shell when calc quits. I've got the first part of that ...
0
votes
1answer
79 views

extract numbers from org mode table and multiply and divide numbers while ignoring units

I would like to extract the numbers from a table like | 21.57 Mg | 10^3 g | 1 m^3 | |-----------+--------+--------| | 1.4^3 m^3 | 1 Mg | 10^3 L | and multiply / divide the numbers while ignoring ...
0
votes
0answers
33 views

How to use emacs calc to grab all x:xx time form from range/buffer to calc the sum of the times?

I have a org-mode buffer full of the clock-ins & clock-outs and I want to sum the intervals which have the form of x:xx, like 0:13 in the following range: * Tasks ** btc-admin CLOCK: [2017-06-...
0
votes
1answer
67 views

Exit from Total Algebraic mode in Spacemacs

I started following Calc-mode tutorial in Spacemacs and I noticed that, once we get in Total Algebraic mode(C-x * c, to start calc-mode, then m t to enable total algebraic mode) the way we should exit ...
2
votes
0answers
44 views

Replace formula by computed value

I'd like to select a simple formula like 17+5 and replace that by the computed result, 22 in this case. And I need this to work during keyboard macro execution, to quickly process large portions of my ...
2
votes
1answer
124 views

How can I calc duration between two dates

I'd like to calculate duration time between two dates in calc. <2017-03-21 Mon 18:45> - <2017-03-20 Mon 18:45> = 24 hr How can I do it? I can insert a date to calc by typing ' <2017-...
4
votes
2answers
151 views

Can I use calc-eval to solve an equation?

I regularly use calc-eval in the *scratch* buffer to work out some quick calculations. I know that I can use some simple functions inside the calculation string, e.g. log. However I am not certain ...
2
votes
1answer
32 views

Catch invalid calc expression

Inspired by this blog I wrote a function which replaces arithmetic expressions between two $ symbols with the mathematical result inline (and deletes the $ symbols). How can I modify this such that it ...
1
vote
2answers
195 views

Calc: copy only a value, not stack number

This seems so obvious that I feel sure that I've just missed something in the manual. I frequently do a calculation and then want to use that calculation elsewhere. But let's say my stack is currently:...
1
vote
2answers
267 views

How to use Calc vector functions

This discussion got me investigating Calc programming with elisp, especially at the bottom this code (defmath myFact (n) (format-number (calcFunc-fact n))) then (calcFunc-myFact 33) yields ...
1
vote
0answers
24 views

Calc vector mapping: shape of result

What determines the shape of the result of a vector mapping (V M)? I had thought it was directly based on the shape of the input, but have a look at this. k f factors an integer, returning a vector ...
5
votes
1answer
95 views

Is it possible to make calc autocomplete units?

Is there some extension that can make calc autocomplete units while value entered as algebraic input? e.g. ' 1 kn<tab> should be completed to "1 knot".
1
vote
1answer
87 views

quick-calc via emacsclient

It's really handy to get stuff calculated in minibuffer using quick-calc (C-x * q) - I especially like that it automatically copies the result into buffer so it's just one C-y away. Now the questions ...
4
votes
1answer
185 views

converting emacs calc eqn to latex in org table

Is it possible to convert column 2 to latex in org-table using a command? It seems that the technology already exists with calc-embed but I don't know how to use it here. | G | 7*(-2:5)+5*(4:7) ...
9
votes
0answers
108 views

Significance arithmetic in calc

I would like to perform significance arithmetic in calc-mode. For example, I want 5000 to have one significant figure, and 5.0e3 to have two significant figures. Calculations should preserve ...
9
votes
0answers
124 views

Saving Calc trail for later use

Is there a possibility to save the Emacs Calculator Trail (as a file) and to restore it later? If not, should it be feature? For example, when I have an incomplete calculation but have to shutdown ...
3
votes
2answers
205 views

calc: how to specify radix while yanking

I know I can yank into the stack in calc using C-y. However, it seems that calc automatically assumes that I'm yanking in a base-10 number. If I try to specify a radix (like 16# for hex) before ...
4
votes
1answer
328 views

How can I add/subtract vectors by Calc in Org-mode?

I want to add/subtract two vectors, X and Y in Calc. If I calc constant numerics within Org-mode source block, it's o.k. #+BEGIN_SRC calc :session *Calculator* [1,1] + [2,2] + [3,3] #+END_SRC #+...
27
votes
2answers
600 views

How can I print an Emacs frame?

The function ps-print-buffer-with-faces prints an Emacs buffer. Is there a way to print a frame with more than one buffer in it? I would like to print an Emacs calc frame both with the RPN stack and ...
1
vote
1answer
103 views

How to force Org to interpret Calc result as a column?

Here's an example: | low | high | students | F(students) | |-----+------+----------+-------------| | 0 | 30 | 15 | 15 | | 30 | 60 | 30 | 45 | | 60 | 70 | ...
5
votes
4answers
334 views

Add a constant decimal value to a column of numbers

Suppose I have a file containing the following: ATOM 10 H5 LIG 1 -0.684 2.034 0.000 1.00 0.00 ATOM 11 C1 LIG 1 0.974 0.686 0.000 1.00 0.00 ATOM 12 H1 ...
1
vote
1answer
118 views

How to set the engineering notation as default in calc?

In calc, I can switch to the engineering notation by pressing d e. But how do I make that a default? I can store the calc defaults in the file specified in the calc-settings-file variable but I can't ...
3
votes
2answers
147 views

Calculations à la Emacs Rocks — with `multiple-cursors`

In this "Emacs Rocks" video relating to the library multiple-cursors ( https://github.com/magnars/multiple-cursors.el ), the author demonstrates a way of swiftly performing calculations, getting the ...
2
votes
1answer
451 views

Calling the calc stack from babel: displaying percentages

Calc supports displaying results as percentages with c %. How can I make babel return this? I tried: #+BEGIN_SRC calc 1 2 '/ 'c% #+END_SRC But this just gives an error. I also tried with a space ...
7
votes
1answer
231 views

How can I turn [1..10] into [1,2,3,4,5,6,7,8,9,10] in calc?

When playing around with data in calc, I often want to generate a vector from an interval. How can I easily create a vector from just a start point, end point & step value. Something like 1 <...
3
votes
1answer
134 views

Calc won't fit any curve to any data, complains “Model expression is too complex”

Even if I copy the example from here: http://www.gnu.org/software/emacs/manual/html_node/calc/Linear-Fits.html#Linear-Fits this one: [ [ 1, 2, 3, 4, 5 ] [ 5, 7, 9, 11, 13 ] ] to be more specific,...