The QBasic Forum      Other Subforums, Links and Downloads
 Return to Index  

AARrrrrrrrr! Doubles AGAIN? Forget those French gamblers.

March 13 2009 at 3:31 PM
  (Login burger2227)
R


Response to Not very accurate, but a start

Try this:

pi# = 4 * ATN(1#) 'VERY accurate!

If you want single:

pi = 4 * ATN(1) 'good enough usually

DEFDBL is suicide! Especially in QB 4.5 because it runs slower and innacurately with Doubles in exponent and multiplication! There is a fix for speed issues called FFIX.

To help with exponential errors returned as Double:

pie = 2 ^ 10 'pie defaults to Single normally

Ted





    
This message has been edited by burger2227 on Mar 13, 2009 4:04 PM
This message has been edited by burger2227 on Mar 13, 2009 3:33 PM


 
 Respond to this message   
Responses