Linked Questions

5 votes
2 answers
172 views

N not behaving in the way I expected it would [duplicate]

I'm trying to use the N function to find the percent error between a function and a rounded value of that function. The code looks something like this. ...
mjkaufer's user avatar
  • 153
6 votes
1 answer
573 views

Calculations after NumberForm [duplicate]

As specified in documentation center the functions AccountingForm, NumberForm, etc. are useful only to display numbers in ...
kizol's user avatar
  • 61
2 votes
0 answers
140 views

Rounding to the nearest decimal [duplicate]

If I have a bunch of numbers in a list {1.435243523432,2434.2321321412,5.8239897,...}, without multiplying everything by some power of ten and then dividing by that ...
user9595's user avatar
9 votes
2 answers
3k views

A problem about function N

Toady,I have a problem about N,described as below: For example N[1/3, 5] (* ==> 0.33333*) and ...
xyz's user avatar
  • 655
9 votes
3 answers
418 views

Strange behavior of MemberQ, Position

After importing an array of latitudes and longitudes and trying to find the position of some latitudes I was encountered with an unexpected problem since certain values could not be found for some ...
zoutoftime's user avatar
4 votes
3 answers
3k views

Permanently rounding numbers/values to a given number of significant figures

I am searching for a simple way of rounding and setting an input to a desired number of significant figures. There are a vast number of posts that discuss similar problems, but none address this issue....
George Papadopoulos's user avatar
3 votes
3 answers
3k views

Rounding to the nearest decimal and pasting such output into an Input cell

This question is very closely related to two earlier ones: Rounding to the nearest decimal and How do you round numbers so that it affects computation? but confronts an additional issue not ...
David G. Stork's user avatar
4 votes
3 answers
4k views

Rounding numbers to certain numbers of significant figures

I have code which outputs numbers, for example,(0.2945847, 0.8647834, 1.6*10^-6) and similar. I would like to take these numbers and round them to 4 significant figures, but I can't find a way to do ...
Aidan's user avatar
  • 43
5 votes
2 answers
375 views

How to prevent Round with hidden fractions

I found a strange behavior in Round. If we try: ToString[Round[4.811, 0.01], InputForm] we get: 4.8100000000000005 When I expected 4.81 In order to get ...
Murta's user avatar
  • 26.4k
0 votes
1 answer
80 views

How to switch a number back from AccountingForm? [closed]

I am working with a function that returns output in AccountingForm format. I would like to do math with that output, but Mathematica does not recognize it as ...
Michael Stern's user avatar
1 vote
2 answers
59 views

Truncating digits after calculation

I am working on numerical solutions to PDEs. I get some outputs which I then place back into the original equation to check my answers against expected values which are the original inputs. The ...
BillT's user avatar
  • 23
0 votes
0 answers
35 views

N[variable,2] displays 6 digits [duplicate]

The following code doesn't behave as I expect. Rather than getting 2 digits upon varying r, I get the default value of 6 digits. What's up? ...
Stephen's user avatar
  • 1,206