PDA

Click to See Complete Forum and Search --> : Trouble with accuracy in VB6


FSPH
Sep 2nd, 2007, 11:07 AM
Hello there,

the result of the computation below in VB6 contradicts a sampe computation in a text book. Could you please plug this in for me.........?


Const dblPi as double = 3.141592

X = ((2 * dblPi * 288) / 365) * (180 / dblPi)


My result is 284.054 degree, while the text book suggests 284.16 degree.

I don't know what's going on here - I would be grateful for any feedback.

Thank you!

zaza
Sep 2nd, 2007, 12:34 PM
This isn't going to be an accuracy issue. Something is awry somewhere. In your calculation above, the dblPi drops out (because it is on the top and bottom of the equation), so you are left with:

X = 2 x 288 x 180 / 365 = 284.055


Either you have missed something out or there is a typo in the book.


zaza