A Problem with Mathematica's Precision

  • Mathematica
  • Thread starter natski
  • Start date
  • Tags
    Precision
In summary, The conversation discusses the use of the N function in Mathematica and how it can be used to round numbers to a desired number of significant figures. It is mentioned that using a backtick (`) followed by the desired number of significant figures can achieve this, or alternatively using a decimal point (.) followed by the desired number of decimal places. It is acknowledged that the reason for this discrepancy is unclear.
  • #1
natski
267
2
Hi all,

Perhaps it is just me that is bugged by this, but I can never get the N function to work in Mathematica.

For example, try doing:

N[6.50889261991, 2]

and you get:

6.50889

Which clearly isn't to 2 significant figures or decimal places...

Does anyone know if there is something I am doing wrong with N?

Natski
 
Physics news on Phys.org
  • #2
natski said:
Hi all,

Perhaps it is just me that is bugged by this, but I can never get the N function to work in Mathematica.

For example, try doing:

N[6.50889261991, 2]

and you get:

6.50889

Which clearly isn't to 2 significant figures or decimal places...

Does anyone know if there is something I am doing wrong with N?

Natski
You can use 6.50889261991`2 to get it to 2 significant figures. Or alternatively you can use 6.5`2

I don't know why N doesn't degrade the precision of the input, but I get the same result.
 
  • #3


Hi Natski,

Thank you for bringing this issue to our attention. It seems that there may be a problem with Mathematica's precision when using the N function. Have you tried adjusting the precision settings in the N function? It is possible that the default setting may not be suitable for your needs.

You can also try using the Round function to achieve the desired level of precision. For example, Round[6.50889261991, 0.01] will give you a result of 6.51 to 2 decimal places.

If the issue persists, it may be worth reaching out to the Mathematica support team for further assistance. They may be able to provide more insight and help resolve the issue. Thank you for bringing this to our attention and I hope this helps.
 

1. What is Mathematica's precision and why is it important?

Mathematica's precision refers to the level of accuracy and detail in the numerical values it calculates. It is important because it affects the reliability and accuracy of the results obtained from calculations.

2. What are some common problems with Mathematica's precision?

Common problems with Mathematica's precision include round-off errors, loss of significant digits, and inaccurate results due to machine precision limitations.

3. How can I improve Mathematica's precision for my calculations?

You can improve Mathematica's precision by using higher precision data types, such as arbitrary precision numbers or symbolic expressions, and limiting the use of machine precision numbers.

4. Why do some calculations in Mathematica result in "indeterminate" or "infinity" values?

Some calculations in Mathematica may result in "indeterminate" or "infinity" values due to division by zero or other mathematical operations that cannot be accurately represented with finite precision numbers.

5. Is Mathematica's precision the same as numerical precision in other software?

No, Mathematica's precision is not the same as numerical precision in other software. Mathematica uses a unique precision system that allows for greater flexibility and accuracy in calculations, but also requires a deeper understanding of precision and its potential limitations.

Similar threads

Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
Back
Top