mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Programming

Reply
 
Thread Tools
Old 2019-08-15, 11:19   #1
mnh001
 
Apr 2011

4016 Posts
Default next after UBasic?

For all my programming needs involving math I use UBasic, which was built specifically for large integer number theoretic operations (2600 digits). It works great because the functionality is built in so you don't have to go through programming coniptions just to get a result out of it. However the day will come when my 32-bit machines (XP and Win7) will no longer operate. And to use UBasic on a 64-bit machine requires a shell program (like Dos-Box) where it runs approx. 30 times slower. Being slow is not a positive selling point.

So the question is: what other programming languages are out there that can do large integer math? How much functionality is built in? What kind of learning curve have they?
mnh001 is offline   Reply With Quote
Old 2019-08-15, 11:55   #2
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

149310 Posts
Default

Try Pari-gp: https://pari.math.u-bordeaux.fr/ .
R. Gerbicz is offline   Reply With Quote
Old 2019-08-15, 12:29   #3
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

3,853 Posts
Default

paulunderwood is offline   Reply With Quote
Old 2019-08-16, 10:16   #4
Xyzzy
 
Xyzzy's Avatar
 
Aug 2002

24×3×173 Posts
Default

https://rosettacode.org/wiki/Arbitra...gers_(included)


Edit: Python is very easy to learn.
Xyzzy is offline   Reply With Quote
Old 2019-08-16, 12:05   #5
mnh001
 
Apr 2011

26 Posts
Default

Thanks for the suggestions.



Do these programs come as a complete package? Ie, open the installer and it installs everything needed to run?



Or do they just install part, then I have to go over here to get the data files and over there to get the libraries, etc? (I always have trouble with that.)
mnh001 is offline   Reply With Quote
Old 2019-08-16, 12:29   #6
xilman
Bamboozled!
 
xilman's Avatar
 
"π’‰Ίπ’ŒŒπ’‡·π’†·π’€­"
May 2003
Down not across

10,949 Posts
Default

Quote:
Originally Posted by mnh001 View Post
Thanks for the suggestions.



Do these programs come as a complete package? Ie, open the installer and it installs everything needed to run?



Or do they just install part, then I have to go over here to get the data files and over there to get the libraries, etc? (I always have trouble with that.)
IME, Pari/gp is a one-shot installer, unless you want to do something unusually specialized. If you have been happy with UBASIC (and I was 25 years ago when I was running APRT-CL on x^y+y^x numbers) you are not doing anything particularly unusual,
xilman is online now   Reply With Quote
Old 2019-08-16, 13:22   #7
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

3,853 Posts
Default

Quote:
Originally Posted by mnh001 View Post
Thanks for the suggestions.



Do these programs come as a complete package? Ie, open the installer and it installs everything needed to run?



Or do they just install part, then I have to go over here to get the data files and over there to get the libraries, etc? (I always have trouble with that.)
Pari/GP is one download. It is well documented and is supported by the community, including mersenneforum.

It has a special number theory section which allows you to do thing such as forprime(), fordiv(), isprime(), ispseudoprime() etc. Enter ? or ?? or ??? at the command line for detailed help.

You can run interactively at the command line either with gp or gp -q. Or you can interpret a file containing commands; you can pipe it and you can use it as a C library.

Try it out on the site's webpage or try the download either for Windows, Linux. Mac or Android.

It is algoloid and does not suffer from spaghetti code associated with BASIC.

Last fiddled with by paulunderwood on 2019-08-16 at 13:40
paulunderwood is offline   Reply With Quote
Old 2019-08-16, 17:54   #8
mnh001
 
Apr 2011

26 Posts
Default

Great info guys. I appreciate it. I might have to try both.
Another question comes to mind. I don't usually do anything with graphics but do either of these have a GUI? Like say I wanted to draw a square with a slider below it and the color of the square changed depending on the value of the slider. Is something like that possible?
mnh001 is offline   Reply With Quote
Old 2019-08-16, 19:10   #9
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

74158 Posts
Default

Quote:
Originally Posted by mnh001 View Post
Great info guys. I appreciate it. I might have to try both.
Another question comes to mind. I don't usually do anything with graphics but do either of these have a GUI? Like say I wanted to draw a square with a slider below it and the color of the square changed depending on the value of the slider. Is something like that possible?
I not sure that Pari/GP can do it. Here is a list of plot commands:

Code:
plot           plotdraw       plotlines      plotrbox       plotscale
plotbox        ploth          plotlinetype   plotrecth      plotstring
plotclip       plothraw       plotmove       plotrecthraw   
plotcolor      plothsizes     plotpoints     plotrline      
plotcopy       plotinit       plotpointsize  plotrmove      
plotcursor     plotkill       plotpointtype  plotrpoint
Attached is the result of ploth(x=1,10,x^2*sin(x))
Attached Thumbnails
Click image for larger version

Name:	Screenshot at 2019-08-16 20-05-02.png
Views:	240
Size:	19.6 KB
ID:	20916  

Last fiddled with by paulunderwood on 2019-08-16 at 19:10
paulunderwood is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
ubasic: overflow? Andi47 Programming 7 2009-02-27 00:20
Ubasic: Illegal program? Andi47 Programming 16 2009-02-20 06:41
ubasic question - strings Andi47 Programming 5 2008-12-28 05:52
Ubasic Array question rn0dal Programming 6 2004-09-15 14:57
Trial Factoring in uBasic dsouza123 Programming 28 2003-11-23 18:20

All times are UTC. The time now is 08:03.


Sun Oct 17 08:03:46 UTC 2021 up 86 days, 2:32, 0 users, load averages: 1.39, 1.62, 1.50

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.