[Coco] A Basic09 Query

Bill Gunshannon bill.gunshannon at hotmail.com
Tue Aug 27 10:23:35 EDT 2019

On 8/27/19 9:17 AM, Gene Heskett wrote:
> 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.

That was my mistake.  I never meant to include SQUARE ROOT.  I
only wondered about SQUARE and Pi.


More information about the Coco mailing list