[Coco] A Basic09 Query
James Jones
jejones3141 at gmail.com
Tue Aug 27 12:17:15 EDT 2019
That reminds me... some operations and functions in BASIC09 are
polymorphic--I suspect they have different codes internally. It would be
nice to have a REAL^INTEGER flavor of exponentiation which one could
implement to only do O(log(base)) multiplies (plus a divide if the exponent
is negative).
It would certainly speed up the old David Ahl benchmark.
On Tue, Aug 27, 2019 at 9:48 AM Alex Evans <varmfskii at gmail.com> wrote:
> I don't remember about Basic09, but I have dealt with situations where
> x^2 will fail if x<0. This is because, if you implement it as
> exp(y*ln(x)), ln(x) is not real when x<=0.
>
> On Tue, Aug 27, 2019 at 10:38 AM Wayne Campbell <asa.rand at gmail.com>
> wrote:
> >
> > On Tue, Aug 27, 2019, 7:22 AM Bill Gunshannon <
> bill.gunshannon at hotmail.com>
> > wrote:
> >
> > > On 8/27/19 9:16 AM, Wayne Campbell wrote:
> > >
> > > > Basic09 is already as
> > > large
> > > > as a program can get and still run in a 64k space. I think Curtis
> may be
> > > > able to say whether it's a calculation or not.
> > >
> > > I doubt it is.
> > >
> >
> > Perhaps I should have included "for a programming language". As it
> stands,
> > while you can increase your workspace size to roughly 40k, anything over
> > 32k and you can't run the procedure in the workspace or use the debugger.
> > You have to pack the code to run it using RunB, and include your own
> > debugging code to help track down problems.
> >
> > As for SQ, wouldn't a PowrOf function have been a better answer?
> > >
> >
> > Since I am not familiar with the term, PowrOf, I can't say. But there
> > already is 2 tokens for exponent, ^ and **. They both do the same thing,
> > and I always wondered why that duplication was there. So, SQ(10) is the
> > same as 10**2 and 10^2. It may be that it's those complicated terms like
> > what James used that make the difference?
> >
> > Wayne
> >
> > --
> > Coco mailing list
> > Coco at maltedmedia.com
> > https://pairlist5.pair.net/mailman/listinfo/coco
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>
More information about the Coco
mailing list