This is in the FAQs.  It has to do with representation of floating point
numbers.  You can not represent 'pi' exactlly in the 53 bits of precision
in floating point.  If you notice, 2^-53 is 1.1e-16 which indicates the
'roundoff' is in the least significant bit of the precision; this is to be
expected with floating point numbers.
__________________________________________________________
James Holtman        "What is the problem you are trying to solve?"
Executive Technical Consultant  --  Office of Technology, Convergys
[EMAIL PROTECTED]
+1 (513) 723-2929


                                                                                       
                                                    
                      "Branimir K.                                                     
                                                    
                      Hackenberger"                To:       <[EMAIL PROTECTED]>       
                                             
                      <[EMAIL PROTECTED]>               cc:                            
                                                         
                      Sent by:                     Subject:  [R] calculating error     
                                                    
                      [EMAIL PROTECTED]                                                
                                                
                      ath.ethz.ch                                                      
                                                    
                                                                                       
                                                    
                                                                                       
                                                    
                      09/12/2004 14:28                                                 
                                                    
                                                                                       
                                                    
                                                                                       
                                                    





Could anybody explain this results?

>sin(2*pi)
-2.449213e-16         #should be zero


>(10^16)*sin(log2(4)*pi)
-2.449213             #should be zero too


and explain what to do to correct this events?

Thanks!!!


Branimir K. Hackenberger

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to