I have updated the BBC BASIC Console Mode editions (BBCTTY) to version 0.49. This fixes a minor bug in the array slicing functionality added in v0.48; the bug affected passing a slice as a parameter to a function or procedure.
In this release I have added the bigint.bbc library, which provides an Arbitrary Precision Integer Arithmetic capability (addition, subtraction and multiplication, currently). This library makes extensive use of array slicing.
Also included is the example program fibo100k.bbc which utilises the bigint library to calculate the Fibonacci number F(478497) which has 100,000 decimal digits. Because of memory (and speed) limitations, the Raspberry Pi Pico edition comes with fibo10k.bbc instead.
The new version can be downloaded from the usual place.
Console Mode editions updated to version 0.49
-
- Posts: 366
- Joined: Tue 18 Jun 2024, 09:32
- hellomike
- Posts: 192
- Joined: Sat 09 Jun 2018, 09:47
- Location: Amsterdam
Re: Console Mode editions updated to version 0.49
The bigint.bbc library is smaller, neater, faster, using array slicing and better documented than before, and... works with BB4W!
I assume the speed increase running fibo100k from over 4.5 second (using BBCSDL with its own library) to less than 2.2 seconds (using BBCSDL with the new library) is due to the use of array slicing?
Thanks Richard
Mike
I assume the speed increase running fibo100k from over 4.5 second (using BBCSDL with its own library) to less than 2.2 seconds (using BBCSDL with the new library) is due to the use of array slicing?
Thanks Richard
Mike
-
- Posts: 366
- Joined: Tue 18 Jun 2024, 09:32
Re: Console Mode editions updated to version 0.49
What version of BBCSDL are you running? If it's 1.41b (the most recent release) the version of bigint.bbc it comes with is the same as the version which comes with BBCTTY.
Well, actually, there is a tiny difference because I noticed that in the v1.41b version of bigint.bbc PROCbigumul can fail if the two numbers being multiplied together differ by more than about 10^900 in their magnitudes (put another way, if the larger number is more than about 900 decimal digits longer than the smaller number)! The BBCTTY version fixes this.
- hellomike
- Posts: 192
- Joined: Sat 09 Jun 2018, 09:47
- Location: Amsterdam
Re: Console Mode editions updated to version 0.49
I'm on 1.41a and this bigint library doesn't use array slicing.
Anyhow, a 100% speed increase because of incorporating array slicing is awesome.
The overhaul and (more) extensive use of PROC fall through syntax is a joy to observe, even though the vast majority of code goes way over my head.
But it always inspires me to continue coding.
You outdone yourself again.
Anyhow, a 100% speed increase because of incorporating array slicing is awesome.
The overhaul and (more) extensive use of PROC fall through syntax is a joy to observe, even though the vast majority of code goes way over my head.
But it always inspires me to continue coding.
You outdone yourself again.
-
- Posts: 366
- Joined: Tue 18 Jun 2024, 09:32
Re: Console Mode editions updated to version 0.49
You should update to 1.41b because the principal reason for the release was to fix the (unforgivable) bug in dlglib.bbc which broke ComboBoxes. It also adds the Unifont.otf font, which can be valuable if you need some of the more uncommon Unicode glyphs.