Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 2370

Calculator mode: Calculator major mode.

3 votes

calc and evaluation of rational fractions

Original question: Is it possible that the evaluation of ((x-1)/(x+1))+((x+1)/(x-1))=> returns ((x-1)/(x+1))+((x+1)/(x-1))=>(2 x^2 + 2) / (x^2 - 1) The calc function nrat transforms its expression … You can try nrat(((x-1)/(x+1))+((x+1)/(x-1))) with M-: (calc-eval "nrat(((x-1)/(x+1))+((x+1)/(x-1)))") The result is: (2*x^2 + 2) / (x^2 - 1) If you prefer to work with the Calc stack you can put ( …
Tobias's user avatar
  • 33.7k
0 votes
Accepted

Substitute a function in an algebraic expression

See the Calc manual on calc-substitute. … Quote: The ‘a b’ (‘calc-substitute’) [‘subst’] command substitutes all occurrences of some variable or sub-expression of an expression with a new sub-expression. …
Tobias's user avatar
  • 33.7k
0 votes

Is it possible to make calc autocomplete units?

The extension (not as a package but as code): (require 'calc) (require 'calc-aent) (require 'calc-units) (defun calc-do-alg-entry-completion (fun &rest args) "Call `calc-do-alg-entry' as FUN with ARGS … " #'calc-aent-complete-word) (advice-add 'calc-do-alg-entry :around #'calc-do-alg-entry-completion) …
Tobias's user avatar
  • 33.7k
5 votes
Accepted

how to do simple calculations on numbers in text

You can do that interactively by query-replace-regexp with embedded Elisp in the replacement string. Go to the beginning of the file. Type M-x query-replace-regexp RET. Input {x: \([0-9]+\), y:\([0- …
Tobias's user avatar
  • 33.7k
2 votes
Accepted

Convert hex to int, little endian

#x1234 is just a hex number and not a byte-encoding. You can easily define a byte encoding yourself. For an instance with the following my-byte-decode function: (defun my-byte-decode (list) "Decode …
Tobias's user avatar
  • 33.7k
1 vote

Saving Calc trail for later use

Afterwards you can use the calc-trail-mode bindings to evaluate parts of the read-in calc commands. (defvar-local calc-trail-buffer-file-name nil "Like `buffer-file-name' for calc-trail buffers.") … (push #'calc-trail-save write-contents-functions) (local-set-key (kbd "C-x i") #'calc-insert-file)) (add-hook 'calc-trail-mode-hook #'calc-trail-install-save) …
Tobias's user avatar
  • 33.7k
1 vote
Accepted

evaluation of calc formulas in orgtbl?

You can enforce an additional evaluation of calc by simplify: |-----+----+---+-------| | x | -2 | 0 | 3.7 | |-----+----+---+-------| | 2 x | -4 | 0 | 7.4 | | x^2 | 4 | 0 | 13.69 | #+TBLFM: @<<$ …
Tobias's user avatar
  • 33.7k
2 votes
Accepted

Problems using ^ in calc

Looks like you have composed characters (^U is composed to Û). That is usually already controlled by the OS. Just hit the spacebar after typing ^ to get a caret as input character.
Tobias's user avatar
  • 33.7k
4 votes
Accepted

org-mode spreadsheet multiply 2 columns element-wise using GNU Emacs Calc formula

Your guess inner is right. The first two operands of inner are the multiplication and the summation operator, respectively. The remaining two arguments are the vectors for the inner product. The summ …
Tobias's user avatar
  • 33.7k
5 votes
Accepted

Org table: Calculate units

You can write the operation into the first inner calc-eval of the linked answer. … (math-convert-units (calc-eval (concat "12 V * " $4) 'raw) (calc-eval "W" 'raw))) Note that this works with the setting M-x calc-normal-language. …
Tobias's user avatar
  • 33.7k