Recent

Author Topic: Re: [prime numbers]Script is taking more time to finish with higher integers  (Read 1798 times)

GetMem

  • Hero Member
  • *****
  • Posts: 4026
Re: [prime numbers]Script is taking more time to finish with higher integers
« Reply #30 on: January 25, 2023, 09:31:34 pm »
@Blaazen

I squeeze a little more juice out of it. I did the following:
Code: Pascal  [Select][+][-]
  1. FPrimes: array of 0..1;
The memory footprint it's not smaller, but the speed increased a little bit. I also optimized the loading process in the tree. Now the program list primes as follows:
2 -> 1,000,000  in 26 ms
2,920,000,000 -> 2,921,000,000 in ~20 sec

Quote
It can be easily implemented with TBits which will occupy just 1/8 of memory but will be slower.
Good idea. I will try it soon.

PascalDragon

  • Hero Member
  • *****
  • Posts: 4967
  • Compiler Developer
Re: [prime numbers]Script is taking more time to finish with higher integers
« Reply #31 on: January 25, 2023, 10:19:35 pm »
We have Odd() for that. Silly answer. And that it an intrinsic.

Odd is not an intrinsic.

 

TinyPortal © 2005-2018