1
$\begingroup$

I've made a Manipulate app. in Mathematica where I vary the value of a function f(a) by varying the parameter a. However, I seem to only be able to edit my input for a for a value up to 5 decimal places (if I enter in a number with more than 5 decimal places, it rounds the figure). Is it possible to increase the number of decimal places with which I can enter in my value of a into the manipulate input?

$\endgroup$
2

1 Answer 1

4
$\begingroup$

Initially I forgot to specifically address Manipulate. In addition to this post see also:

Manipulating an arbitrary-precision ContourPlot


This question may qualify as a duplicate (I'll let the community votes decide) but it has been asked in a different way so I'll answer it anew.

There are two issues that may be confounded here: input syntax and output formatting.

Input syntax

By default a number entered with a decimal point that has less than 18 digits is interpreted as a machine precision number, while one with more is interpreted as arbitrary precision:

12.                             // Precision
2.7182818284590452              // Precision
2718281828459045.2              // Precision
2.71828182845904523536028747135 // Precision

MachinePrecision

MachinePrecision

MachinePrecision

29.4343

Any number (with or without a decimal point) can be entered with a specific precision by using the ` symbol. A raw ` means MachinePrecision while e.g. `7 means seven digits of precision:

12`      // Precision
12.3`1   // Precision
3.14`20  // Precision

MachinePrecision

1.

20.

Arithmetic between arbitrary and machine precision numbers automatically converts to machine precision:

12.3`1 * 17.2 // Precision

MachinePrecision

See also: Converting to machine precision

Output formatting

Machine precision numbers are by default automatically truncated to six digits in OutputForm, but more digits are still there internally:

2.7182818284590452 // InputForm

2.718281828459045

Methods to control this formatting are presented in: Annoying display truncation of numerical results

One of my own recommendations:

SetOptions[$FrontEndSession, PrintPrecision -> 10]

2.7182818284590452

2.718281828

This Option can be set globally: $FrontEnd, for a session: $FrontEndSession, for a particular Notebook: EvaluationNotebook[], or even for a particular cell or expression (with the Option Inspector for Cells or Style for single expressions).

$\endgroup$

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.