Results 1 to 5 of 5

Thread: Big Integer module

  1. #1
    Member Johannes's Avatar
    Join Date
    Nov 2010
    Location
    Wuustwezel, Belgium
    Age
    56
    Posts
    95
    Rep Power
    25

    Big Integer module

    This is the first complete release of my BigInt module for thinBasic.

    All functionality that was in the thinBasic include script is present, along with functions to control conversion between ASCII strings and Big Integers.

    Apart from the module DLL the zip file contains a small text file that explains how to get things started, a thinBasic script that tests all keywords and performs integrity checks, and a PDF manual. That manual is what makes the zip file so big, the original OpenOffice document is only 40 kBytes uncompressed.


    Future developments
    • Internal addition, subtraction and multiplication are still in standard PowerBASIC. I will convert these to assembler which should speed up most operations.
    • Some optimisations will certainly be added for BigInt_Prm and BigInt_Cmb. I will check the other functions to see if they can be optimised as well.
    • Binary logic (and, or, etc.) and bit stream (set, clear, shift, rotate, etc.) functions will be added. Descriptions of these functions are already in the manual.
    If you have any questions or bug reports, or if you have suggestions for new or expanded functions, or would like to see some aliases added (e.g. BigInt_DivideWithRemainder for BigInt_DivRem), create a topic for it in this subforum and I'll see what I can do.
    Last edited by Johannes; 04-03-2011 at 16:19.
    Boole and Turing, help me!

    Primary programming: 200 MHz ARM StrongARM, RISC OS 4.02, BASIC V, ARM assembler.
    Secondary programming: 3.16 GHz Intel Core 2 Duo E8500, Vista Home Premium SP2, thinBasic, x86 assembler.

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    Hi Johannes,

    the library itself is very powerful and the documentation is detailed and professionaly presented. Good job!


    Petr

    P.S. I can see the attachement in first post okay.
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    Member Johannes's Avatar
    Join Date
    Nov 2010
    Location
    Wuustwezel, Belgium
    Age
    56
    Posts
    95
    Rep Power
    25

    Major Bug Fix!

    Found a real doozy, in the internal subtraction subroutine of all places. If the subtracted value is more than one DWord smaller and the first DWord "above" the subtracted value is zero, then it all goes to hell.

    The next bit of code should not print anything.
    Uses "Console"
    Module "BigInt"
    Alias String As BigInt
    BigInt a,b
    String c
    a=BigInt_FromString("100000000000000000000000000000000_16")
    b=BigInt_FromString("10000000000000000_16")
    c=BigInt_ToString(BigInt_Sub(a,b),16)
    If c<>"+FFFFFFFFFFFFFFFF0000000000000000_16" Then PrintL "Something is wrong..."
    
    New module and test script in zip file in the "latest release" topic. Please upgrade.
    Last edited by Johannes; 06-03-2011 at 13:47.
    Boole and Turing, help me!

    Primary programming: 200 MHz ARM StrongARM, RISC OS 4.02, BASIC V, ARM assembler.
    Secondary programming: 3.16 GHz Intel Core 2 Duo E8500, Vista Home Premium SP2, thinBasic, x86 assembler.

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Quote Originally Posted by Johannes View Post
    New module and test script in zip file. Please upgrade.
    Johannes,

    just a suggestion: in order not to confuse people, it is a good option to have just one (maybe Sticky) thread where the last version of your module can be found avoiding to attach latest version in many different posts.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  5. #5
    Member Johannes's Avatar
    Join Date
    Nov 2010
    Location
    Wuustwezel, Belgium
    Age
    56
    Posts
    95
    Rep Power
    25
    Eros, that is an excellent idea. I will create a new thread with just the latest release and remove the archives from this one.
    Boole and Turing, help me!

    Primary programming: 200 MHz ARM StrongARM, RISC OS 4.02, BASIC V, ARM assembler.
    Secondary programming: 3.16 GHz Intel Core 2 Duo E8500, Vista Home Premium SP2, thinBasic, x86 assembler.

Similar Threads

  1. Big Integer new forum
    By ErosOlmi in forum BigInt module. Big Integer handling by Johannes
    Replies: 1
    Last Post: 27-02-2011, 20:49

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •