Quantcast
Channel: User Peter - Reinstate Monica - Stack Overflow
Viewing all articles
Browse latest Browse all 239

Comment by Peter - Reinstate Monica on Wrote a program to print prime numbers, How do I make it better?

$
0
0
@chux-ReinstateMonica The most efficient optimization would do away with the if altogether (because jumps can be terrible on modern CPUs) and replace it with bit arithmetic, taking advantage of C's weak typing, like return 1 & (number != 1).

Viewing all articles
Browse latest Browse all 239

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>