![]() |
![]() |
#45 |
Feb 2017
Nowhere
6,229 Posts |
![]() |
![]() |
![]() |
![]() |
#46 |
"Robert Gerbicz"
Oct 2005
Hungary
5·17·19 Posts |
![]()
Once you factored n, you could add the primefactors, so then a new numdiv/divisors or any such functions when you know factor() would be called will be much faster.
Code:
? ?addprimes addprimes({x=[]}): add primes in the vector x to the prime table to be used in trial division. x may also be a single integer. Composite "primes" are NOT allowed. |
![]() |
![]() |
![]() |
#47 |
Sep 2002
Database er0rr
24×281 Posts |
![]()
How do I increase threadsizemax before running gp under Linux? I.e. what do I need to put in $HOME/.gprc?
|
![]() |
![]() |
![]() |
#48 |
Aug 2020
79*6581e-4;3*2539e-3
10100100112 Posts |
![]()
To have a progress bar, it would be useful to output a string to the same line, overwriting the previous output. Is that possible? Maybe by using "delete" characters as print() arguments?
|
![]() |
![]() |
![]() |
#49 | |
"Martin Hopf"
Jul 2022
Germany
2×3×7 Posts |
![]() Quote:
Code:
printf(" ... %c", ... , 13) For example counting primes up to 10^9 and get progress information in a fixed line would look like this: Code:
c=0;s=1e9;forprime(p=2,s,c++;if(c%10^5==0,printf(" %3.1f%% %c",p/s*100,13)));c Last fiddled with by Neptune on 2023-01-25 at 12:13 Reason: extension |
|
![]() |
![]() |
![]() |
#50 |
"Martin Hopf"
Jul 2022
Germany
2·3·7 Posts |
![]()
A carriage return is also possible with:
Code:
print1(strchr(13)) |
![]() |
![]() |
![]() |
#51 |
Aug 2020
79*6581e-4;3*2539e-3
659 Posts |
![]()
Thanks, that seems to be what I was looking for!
|
![]() |
![]() |
![]() |
#52 |
"Rashid Naimi"
Oct 2015
Remote to Here/There
234410 Posts |
![]()
Very nice Neptune. Thank you. I too have been looking for a carriage return without the linefeed to no avail.
I have vague memory of cls in the old DOS having a similar functional use. I checked it just now and it works too: Code:
\\ To Clear the Screen system("cls") \\ * Not sure if it would work on a Linux system. Adding your code to my library. Thanks again. ![]() Last fiddled with by a1call on 2023-01-26 at 04:50 |
![]() |
![]() |
![]() |
#53 | |
Sep 2002
Database er0rr
24·281 Posts |
![]() Quote:
Cross platform: print("\e[H\e[2J") Last fiddled with by paulunderwood on 2023-01-26 at 08:20 |
|
![]() |
![]() |
![]() |
#54 |
"Rashid Naimi"
Oct 2015
Remote to Here/There
23·293 Posts |
![]()
Noted and filed to my library. Thank you.
![]() |
![]() |
![]() |
![]() |
#55 |
"Ed Hall"
Dec 2009
Adirondack Mtns
5,261 Posts |
![]()
I've been using printf "Text, text, text. \r" in my bash scripts in linux. Less for me to remember, although from my Windows days I can still remember cr = 13.
|
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
LLL in GP/Pari | paul0 | Programming | 2 | 2015-11-17 13:04 |
Card Tricks | davar55 | Hobbies | 11 | 2013-05-27 14:28 |
How To Evaluate SNFS Polynomial Tricks? | wblipp | Factoring | 4 | 2011-04-15 16:22 |
Tool Tips clobbered by Prime95 (on Win2K) | Bob Stein | Information & Answers | 1 | 2008-04-11 17:52 |
Help/Tips on Buiding Computer? | Unreg | Hardware | 6 | 2004-09-18 18:19 |