Re: I Need Help
- Posted by Larry D Poos <ldpoos at JUNO.COM> Jun 20, 1997
- 757 views
On Fri, 20 Jun 1997 11:05:51 +0000 Mike.Burrell at GEOCITIES.COM writes: >> Try the following statement in Euphoria: >> ? .1 + .1 + .1 + .1 + .1 + .1 + .1 + .1 + .1 + .1 - 1 >> >> You will not get 0. You will get -1.11e-016. > >i tried it and i actually did get zero What kind of machine did you try this on? After reading Roberts reply to my post "I knew that!" came to mind. Numbers to the right of the decimal when converted to 16 bit binary may lose the least significant digits 0.1 base 10 when converted to binary and back to base 10 actually evaluates to 0.0999755859375, an error of 2.4414e-5 This is probably close enough for most applications but would put you about 14.6 miles off course over 10K miles. No problem for large targets but if you need to be with in a few feet this might be a problem. <BG> it will also give you a day or two error when calculating the calendar date from a StarDate. Larry D. Poos -[USMC (Retar{bks}{bks}ired) Havelock, NC]- - Programming and System Consultant, LTAD Enterprises - e-mail: ldpoos at juno.com Fido: 1:3629/101.6