[Coco] A Basic09 Query

Gene Heskett gheskett at shentel.net
Tue Aug 27 09:17:46 EDT 2019


On Tuesday 27 August 2019 07:36:21 Bill Gunshannon wrote:

> On 8/26/19 6:02 PM, Wayne Campbell wrote:
> > PI isn't really a function. It's more of a defined constant.
>
> It's listed as a Function on the Reference Card.  And Basic09 is
> not the only language implementation I have seen to do this.  It
>   may only return the constant value,  but I would assume if it
> is implemented as a function it has the associated overhead.  Thus
> the reason for my question.
>
> >                                                              SQ and
> > SQR both compute the square root of a number. If I recall correctly,
> > one operates on REAL numbers, the other on INTEGER numbers, but I
> > may be misremembering there.
>
> The book lists both as taking "a numeric" and returning "a
> numeric".  Nothing about either being Integer or Real.  But,
> again, why?  Why have the overhead of a function call for a
> simple multiplication?

Because a SQR is a long division? One of the longer to do functions you 
can do? SQ is a simple mull by itself.  Taking the root is a much longer 
process.

> I was hoping one of the former MicroWare denizens might
> remember why this was done in that manner.
>
> bill


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>


More information about the Coco mailing list