home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / sci / math / symbolic / 3349 < prev    next >
Encoding:
Internet Message Format  |  1993-01-03  |  949 b 

  1. Path: sparky!uunet!spool.mu.edu!sdd.hp.com!network.ucsd.edu!sdcc12!oba!mstankus
  2. From: mstankus@oba.ucsd.edu (Mark Stankus)
  3. Newsgroups: sci.math.symbolic
  4. Subject: Bug: Mma thinks Sqrt[3] is rational
  5. Message-ID: <42996@sdcc12.ucsd.edu>
  6. Date: 3 Jan 93 07:40:47 GMT
  7. Sender: news@sdcc12.ucsd.edu
  8. Distribution: usa
  9. Organization: Mathematics @ UCSD
  10. Lines: 32
  11. Nntp-Posting-Host: oba.ucsd.edu
  12.  
  13. Check out this seession. Sometimes gives a decimal approximation
  14. to Sqrt[3] instead of just Sqrt[3].
  15.  
  16. In[126]:= xx = Sqrt[1-r^2]
  17.  
  18. DialogIndent[0]Out[126]= (1 - r^2)^(1/2)
  19.  
  20. In[127]:= xx//.r->0.5
  21.  
  22. DialogIndent[0]Out[127]= 0.866025403784439
  23.  
  24. In[128]:= (* Now  -- the same thing happens *)
  25.  
  26. In[129]:= 1-r^2 /.r->0.5
  27.  
  28. DialogIndent[0]Out[129]= 0.75
  29.  
  30. In[130]:= Sqrt[%]
  31.  
  32. DialogIndent[0]Out[130]= 0.866025403784439
  33.  
  34. In[131]:= (* Now 0.75 = 3/4 *)
  35.  
  36. In[132]:= Sqrt[3/4]
  37.  
  38. DialogIndent[0]Out[132]= 3^(1/2)/2
  39.  
  40. In[133]:= (* Sqrt[3] is not rational *)
  41.  
  42. -- 
  43. mstankus
  44. mstankus@oba 
  45.