A Problem with Mathematica's Precision

  • Context: Mathematica 
  • Thread starter Thread starter natski
  • Start date Start date
  • Tags Tags
    Precision
Click For Summary
SUMMARY

The forum discussion centers on the use of the N function in Mathematica, specifically version 12.3, and its unexpected behavior when attempting to limit the output to a specified number of significant figures. Users reported that using N[6.50889261991, 2] yields 6.50889, which does not conform to the expected output of two significant figures. The solution provided involves using the notation 6.50889261991`2 or 6.5`2 to achieve the desired precision.

PREREQUISITES
  • Familiarity with Mathematica 12.3 syntax and functions
  • Understanding of significant figures and decimal precision
  • Basic knowledge of numerical representation in programming
  • Experience with mathematical functions in computational software
NEXT STEPS
  • Explore the use of precision control in Mathematica with the ` notation
  • Research the differences between N and other numerical functions in Mathematica
  • Learn about numerical precision and representation in computational mathematics
  • Investigate common pitfalls in using Mathematica for numerical calculations
USEFUL FOR

Mathematics students, data analysts, and software developers using Mathematica for numerical computations who need to understand precision handling.

natski
Messages
262
Reaction score
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
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.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 12 ·
Replies
12
Views
5K
  • · Replies 6 ·
Replies
6
Views
2K