# [Coco] A Basic09 Query

Wayne Campbell asa.rand at gmail.com
Tue Aug 27 10:08:31 EDT 2019

```That is an example I wouldn't have thought of, but I see one error in the
syntax. I recognize it because I tested to see if something like x(i*3)
would be seen as x times (i times 3). Basic09 flags it as a syntax error.
The correct syntax is x*(i*3). i times 3 will be calculated before x times
the product of i times 3.

Syntax error: SQ(sin(x)*y(15*i+3)/(5+sgn(w)))
Syntax corrected: SQ(sin(x)*y*(15*i+3)/(5+sgn(w)))

On Tue, Aug 27, 2019, 6:43 AM James Jones <jejones3141 at gmail.com> wrote:

> I don't know how PI is implemented; that would take some looking through
> the source.
>
> Yes, strictly speaking SQ isn't necessary. OTOH ^ isn't necessary, since
> you could write x^y as exp(y * log(x)). The creators of BASIC09 must've
> thought it worth not  having to write x*x, and I can agree with them:
> consider SQ(sin(x)*y(15*i+3)/(5+sgn(w))). You either get to replicate a
> long tedious computation (sure you didn't make a mistake writing it the
> second time?) or create a gratuitous variable to hold the expression you
> want to square.
>
> On Mon, Aug 26, 2019 at 3:41 PM Bill Gunshannon <
> bill.gunshannon at hotmail.com>
> wrote:
>
> >
> > Nothing important, just a couple simple questions.
> >
> > Why would you need a function to return a constant, Pi?
> >
> > And further, why would you need a function to compute a square?
> >
> > Is that not unneeded complexity?
> >
> > bill
> >
> > --
> > 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
>
```