I submitted a feature request for adding a capability in Xojo for large integers. My hobby interest is developing ,testing and understanding math algorithms. At present I am learning number theory algorithms with special interest in prime factorization… Most algorithms need large integer support to be useful. Not very challenging to factor a 64 bit number for instance.
Currently I am using Python with has excellent big integer support. The python capability is its one and only built-in integer.
I’m pretty sure that there are other users that would find this capability useful for things like cryptography.
I tried to find duplicates in Feedback but there as so many feedback cases with “integer” in them that it made the search daunting. Sorry if this is a duplicate.
BigNumberMBS is a floating point with variable length up to 320bits, which is good for 100 digits in precision before the decimal dot. LargeNumberMBS is an integer number with up to 4128 bits, which is enough for about 1224 digits in precision.
We also have an example with BigCurrency class using it for high precision currency replacement.
Thanks for the clarification on the digit size for your LargeNumberMBS plugin. Unfortunately having a fixed limit integer size for number theory algorithms is too limiting. The quadratic sieve algorithm that I am testing now easily gets to final integers that require a greater common divisor calculation that is in the high thousands of digits.
I don’t know if you’re looking for a solution or just want to put eyes on the ticket, so I don’t know if you’ve seen this one http://delaneyrm.com/DecimalPlugin.html or if its of any use to you (I’ve not tried it). Thought I’d mention it just in case you hadn’t seen it/tried it. Edit, ahh I see you’ve found it from your ticket, I’ll go back to sleep now
I’ve mentioned this in the past, and I’ll say it again: Plug-ins are far too slow in most applications to be useful when dealing with large integers or large floating point numbers. When we are dealing with a lot of digits, it almost always means that we also need lots of speed. The overhead involved with invoking a plug-in routine usually negates its benefit.
When I filled out the recent user survey, last week, one of my two top feature requests was for 128 bit floating point numbers.
I think Xojo staff might be surprised at how many people are developing serious number crunching apps in Xojo.
Sam, I did make a big integer class with integers of unlimited size using memory blocks. However I could never get decent speed out of it. Xojo speed is still not on par with C/C++ with this type of number crunching. And packages such as GMP have been worked on for years and blow away most implementations. Some of the functions get quite complex (examples division and exponentiation). My implementation worked as in getting right answers but not fast enough to do serious number theory work such as prime factorization. Much too slow.
it"s kind of a self fulfilling prophecy. You can’t make the math programs you want to if you don’t have the capability in the tool. No capability and the programs (users) don’t happen. Then Xojo thinks there is no interest because no one is actively developing. Duh!
Yes and I can program directly in Python in Python. For most of my work I don’t really need a GUI (just need number crunching and multi-processing to speed us final apps). The issue now is that more of the code that I migrate the less I need Xojo and eventually will not need it at all. At this point I am not building cross platform or developing GUIs. I guess I may have a letting go problem. I have been dabbling in Xojo for many years and have a sentimental attachment. But eventually the paid product will loose to the free one (I am on auto renew and just renewed). Having to buy plugins just makes a hobbyist less inclined to use Xojo. I’m not against companies selling plugins. The issue is if you can’t afford them you become a have not. And if Xojo decides to not fill holes provided by commercial plugins the Xojo base capability will never evolve. Just my opinion.
BTW its not just the math capability that is better in Python. Multi-precessing is simple and elegant. And what you can do with lists, dictionaries and sets is just amazing.
I feel that Xojo has their hands full with the breadth of the product with changing frameworks and the ever increasing number of platforms being developed for. And I understand that multi-platform is their core business. I really don’t think that math capabilities will ever be addressed. But letting Xojo know my needs and opinion is just good customer behavior. And if anyone feels the same then let your voice be heard. I read in other threads something to the point “we don’t see customers using this or that” . Xojo, “I use integers a lot” and need a bette capability.
i’m sure that you are right about the class overhead and it was definitely written for the
bi = bi + 6 case.
it:s been a while since I worked on it and I would have to sift through the versions to find a good one to send to you. At the time I was converting to the new framework (remember that). I should have a version on the old framework and I will look when I get some time.