Message Boards Message Boards


Warning to New Users: There are 7 kinds of numbers in Mathematica

Posted 8 years ago
0 Replies
2 Total Likes

Integers (Infinite Precision), Reals (Infinite Precision, Machine Precision, Arbitrary Precision), Complexes ((Infinite Precision, Machine Precision, Arbitrary Precision) with some overlap. That's why the square root of 2 returns the square root of two, to maintain the precision.

In[1]:= Element[1, Integers]

Out[1]= True

In[2]:= Precision[1]

Out[2]= \[Infinity]

In[3]:= Element[2/3, Reals]

Out[3]= True

In[4]:= Precision[2/3]

Out[4]= \[Infinity]

In[11]:= Sqrt[2]

Out[11]= Sqrt[2]

In[10]:= Precision[Sqrt[2]]

Out[10]= \[Infinity]

In[6]:= Precision[1.0]

Out[6]= MachinePrecision

In[7]:= Precision[N[1, 25]]

Out[7]= 25.

In[9]:= Element[2, Complexes]

Out[9]= True

In[8]:= Element[2 + 3 I, Complexes]

Out[8]= True

In[12]:= Precision[2 + 3 I]

Out[12]= \[Infinity]

In[13]:= Precision[N[2 + 3 I, 25]]

Out[13]= 25.
POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract