[Coco] long math subroutine module?

gene heskett gheskett at wdtv.com
Wed Apr 11 23:31:56 EDT 2012


On Wednesday, April 11, 2012 11:25:16 PM Willard Goosey did opine:

> Has anyone written a long (32-bit) integer math subroutine module for
> BASIC-09?  I'm thinking something that uses a record of 2 integers
> (like some of the syscalls want) for each argument.  Something like...
> 
> arg1.hi=1
> arg1.lo=63000
> arg2.hi=0
> arg2.lo=2
> run longmath("*",arg1,arg2,arg3)
> (*result in arg3*)
> 
> ?????
> Willard

So far as I have heard about, no.  I believe the real problem is the size 
of an int in basic09 is 16 bits & even a real is only 5 bytes including the 
exponent.

I believe if you need that in long or double, you'll need to write it in C 
and use the trig.l to get those functions where the accuracy only gets 
fuzzy about 16 or 17 digits out.  They work well until the julian calender 
hits zero in the middle of 4713 BC.

Cheers, Gene
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene>
The absurd is the essential concept and the first truth.
		-- A. Camus



More information about the Coco mailing list