On Thu, Aug 1, 2024 at 8:41 AM Alan Cox <[email protected]> wrote:

> > Seems like a design flaw in BASIC. Since FP numbers cannot exactly
> represent all numbers that can be written in decimal (unless it's some kind
> of BCD format), it really should be keeping those FP numbers stored in a
> decimal or string format.
>
> It gains a massive performance improvement by not doing so. There are
> always tradeoffs. Classic BASIC is clobbered on performance by a bunch
> of things but all the string to float parsing is one of them.
>
>
Yeah, I get it. But given that one would expect some serious warnings about
floating point literals in the manual explaining the problem and how to
make literals that will round-trip through tokenization/detokenization

Or... when it detokenizes for LIST or EDIT it should always give the
closest value that will round-trip, to stop the insanity.

Woulda coulda shoulda

-- John.

Reply via email to