Skip to main content
4
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k
Post Closed as "Duplicate" by Mr.Wizard
Tweeted twitter.com/StackMma/status/664978034181677057
deleted 11 characters in body; edited title
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259

Mathematica Numerical Value Errors N not behaving in the way I expected it would

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.

In[20]:= Tan[10°]

Out[20]= Tan[10°]

In[21]:= N[Tan[10°]]

Out[21]= 0.176327

In[22]:= N[%20] - N[%20, 4]

Out[22]= 0.

In[23]:= N[%22]

Out[23]= 0.

Basically, Mathematica is not recognizing these differences, and thinks they're 0 even when they're not. Does anyone have a workaround for this? I'll probably use IntegerPart if nobody has any thoughts.

Thanks!

Mathematica Numerical Value Errors

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.

In[20]:= Tan[10°]

Out[20]= Tan[10°]

In[21]:= N[Tan[10°]]

Out[21]= 0.176327

In[22]:= N[%20] - N[%20, 4]

Out[22]= 0.

In[23]:= N[%22]

Out[23]= 0.

Basically, Mathematica is not recognizing these differences, and thinks they're 0 even when they're not. Does anyone have a workaround for this? I'll probably use IntegerPart if nobody has any thoughts.

Thanks!

N not behaving in the way I expected it would

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.

In[20]:= Tan[10°]

Out[20]= Tan[10°]

In[21]:= N[Tan[10°]]

Out[21]= 0.176327

In[22]:= N[%20] - N[%20, 4]

Out[22]= 0.

In[23]:= N[%22]

Out[23]= 0.

Basically, Mathematica is not recognizing these differences, and thinks they're 0 even when they're not. Does anyone have a workaround for this? I'll probably use IntegerPart if nobody has any thoughts.

edited tags
Link
Source Link

Mathematica Numerical Value Errors

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.

In[20]:= Tan[10°]

Out[20]= Tan[10°]

In[21]:= N[Tan[10°]]

Out[21]= 0.176327

In[22]:= N[%20] - N[%20, 4]

Out[22]= 0.

In[23]:= N[%22]

Out[23]= 0.

Basically, Mathematica is not recognizing these differences, and thinks they're 0 even when they're not. Does anyone have a workaround for this? I'll probably use IntegerPart if nobody has any thoughts.

Thanks!