[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Applesoft Basic question
- Subject: Re: Applesoft Basic question
- From: SteakMan <steakman@wwa.com>
- Date: Thu, 12 Jan 1995 21:30:01 -0600
- In-reply-to: <199501121728.MAA18761@saguenay.IRO.UMontreal.CA>
- Newsgroups: comp.sys.apple2
- Organization: WorldWide Access - Chicagoland Internet Services
- References: <199501121728.MAA18761@saguenay.IRO.UMontreal.CA>
On Thu, 12 Jan 1995, Paul Guertin wrote:
> In article <3f2ct3$77k@sashimi.wwa.com> you write:
>
> [Applesoft floating-point problem]
>
> You found a bug in Applesoft. That particular bug has been known
> for years, and to my knowledge noone has released a patch for it.
> A simple way to work around it is to separate every operation:
> instead of B = INT(A*100), write B=A*100:B=INT(B). That should
> work in most (all?) cases.
>
Not mine unfortunately.....
> Bugs like this are very common in microcomputer BASICs. They occur
> because the computer uses a binary representation for storing
> numbers, and terminating fractions like 1/10 = 0.1 in decimal
> become repeating fractions in binary, leading to round-off
> errors.
>
Thank you for the informative reply... I'm afraid that I already knew
that. I suppose that I should have asked if anyone knew a good way
around the problem. As it stands, I'm looking at a series of IF THEN
conditions.
I should just invest in a C compiler :(
-------------------------- My Favorite Bumper -------------------------
| Visualise Whirled Peas | Stickers | Only Users Lose Drugs |
--------------------------steakman@sashimi.wwa.com-------------------------