5

Currently Emacs calculator (calculator not calc) only shows, up to three digit decimal values. For example calculating 22/7 gives 3.143. Is it possible to increase the number of displayed digit decimal in Emacs calculator?

3
  • Please clarify which Emacs calculator you are asking about. calc or something else?
    – Drew
    Feb 13, 2015 at 15:03
  • @Drew I think he was clear to begin with. I just didn't know there was an emacs calculator, I thought calc was it!
    – Tyler
    Feb 13, 2015 at 15:05
  • 2
    While we are at it, there's also quick-calc; I have been using it with my custom math commands like alog10, dbv, next2pow, etc Feb 13, 2015 at 22:01

3 Answers 3

7

In calculator mode, { and } control how many digits are displayed.

2

p

From the manual, available in emacs here:

(info "(calc)Precision")

7.2 Precision

The ‘p’ (‘calc-precision’) command controls the precision to which floating-point calculations are carried. The precision must be at least 3 digits and may be arbitrarily high, within the limits of memory and time. This affects only floats: Integer and rational calculations are always carried out with as many digits as necessary.

The ‘p’ key prompts for the current precision. If you wish you can instead give the precision as a numeric prefix argument.

2
  • I use calculator by M-x calculator. Contrary to the calc-mode (M-x calc), it seems that precision p doesn't work there.
    – Name
    Feb 13, 2015 at 14:34
  • Right you are. I'll leave this here for others looking for calc, but I see @SueD.Nymme has given you the correct answer for calculator.
    – Tyler
    Feb 13, 2015 at 15:08
1

This is an easy one: p the number entered afterwards controls the precision of floating-point calculations.

3
  • For calc this works. What about the calculator as in my question?
    – Name
    Feb 13, 2015 at 14:26
  • @Name oh... I haven't even though about it. But I see the answer has already been given. I'll live it until the evening and then remove. No need to duplicate the answers.
    – wvxvw
    Feb 13, 2015 at 17:31
  • Your answer is still helpful for calc.
    – Name
    Feb 13, 2015 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.