Questions tagged [calc]

Calculator mode: Calculator major mode.

This is an RPN calculator featuring arbitrary-precision integer, rational, floating-point, complex, matrix, and symbolic arithmetic.

  • RPN calculation: 2 RET 3 + produces 5.
  • Algebraic style: ' 2+3 RET produces 5.

Basic operators are +, -, *, /, ^, & (reciprocal), % (modulo), n (change-sign).

Press ? repeatedly for more complete help. Press h i to read the Calc manual on-line, h s to read the summary, or h t for the tutorial.

Notations:

  • 3.14e6 3.14 * 10^6
  • _23 negative number -23 (or type `23 n')
  • 17:3 the fraction 17/3
  • 5:2:3 the fraction 5 and 2/3
  • 16#12C the integer 12C base 16 = 300 base 10
  • 8#177:100 the fraction 177:100 base 8 = 127:64 base 10
  • (2, 4) complex number 2 + 4i
  • (2; 4) polar complex number (r; theta)
  • [1, 2, 3] vector ([[1, 2], [3, 4]] is a matrix)
  • [1 .. 4) semi-open interval, 1 <= x < 4
  • 2 +/- 3 (p key) number with mean 2, standard deviation 3
  • 2 mod 3 (M key) number 2 computed modulo 3
  • <1 jan 91> Date form (enter using ' key)
94 questions
27
votes
3 answers

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 the trail buffer.
The Dude
  • 463
  • 3
  • 6
14
votes
2 answers

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 my Emacs, it would be great if i can continue…
estownya
  • 303
  • 1
  • 7
11
votes
5 answers

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: --- Emacs Calculator Mode --- 1: 42 . Any…
Trey
  • 865
  • 5
  • 20
10
votes
0 answers

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 significant figures according to the rules of significance…
Matthew Piziak
  • 5,958
  • 3
  • 29
  • 77
9
votes
1 answer

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 10 1 MAKE-VECTOR to give me…
Squidly
  • 1,499
  • 14
  • 17
8
votes
2 answers

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 should be completed to "1 knot".
gordon-quad
  • 179
  • 3
7
votes
2 answers

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 by putting point behind it and pressing C-x…
George
  • 879
  • 5
  • 17
6
votes
1 answer

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 Grouping mode, in which digits are displayed in clumps…
Name
  • 7,689
  • 4
  • 38
  • 84
5
votes
4 answers

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 LIG 1 1.734 1.451 0.000 1.00 …
holocronweaver
  • 1,319
  • 10
  • 22
5
votes
1 answer

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 | Amount | |---------+--------| | | 4…
5
votes
2 answers

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 doing this is a little harassing. do the…
kotchwane
  • 481
  • 2
  • 12
5
votes
1 answer

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, created two vectors, and typed g f: --- Emacs…
Greg C
  • 97
  • 4
5
votes
2 answers

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 working with emacsclient -t --eval '(calc nil t)'…
izkon
  • 1,798
  • 10
  • 23
5
votes
2 answers

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 whether I can use the solver in the same way. Is it…
Conor
  • 475
  • 3
  • 11
4
votes
3 answers

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) distribution with mean ‘m’ and standard deviation ‘s’. It…
1
2 3 4 5 6 7