Arbitrary Precision Arithmetic support added

7 views
Skip to first unread message

The Beez

unread,
Mar 31, 2026, 7:39:16 AM (9 days ago) Mar 31
to 4tH-compiler
Hi 4tH-ers!

I've been busy chasing some subject - and maybe I'd need that stuff. Now there is a FSL library for just that, but it does a lot of "dictionary magic" - and I frankly didn't want to figure this out.

So I went to look for some equivalent - and subsequently found it on some Russian site, but in C++. It used "vectors". Now, I've added vectors to FOOS some time ago, so that is no problem. 

BTW, vectors are arrays of integers that auto-expand themselves - and I built that on top of the darray.4th library. I needed to add just a few minor thingies to make it function comfortably as APA numbers.

That also meant that using these as vectors meant it could only be implemented as a FOOS library. But what the heck - so I did.

The first tests I made proved it functions as advertised. Note the library is unsigned, but adding a signed layer on top of it isn't very hard. I mean - equal signs are positive, unequal signs are negative. So, where's the problem. Making fixed point arithmetic is trivial as well.

But as things are now, I'll leave it there, because I'm not in current need of all those thingies. I made a small demo, using almost all currently supported methods. All code in SVN, if you're interested. 

Hans Bezemer
Reply all
Reply to author
Forward
0 new messages