User Tools

Site Tools


haas:spring2017:cprog:projects:pnc0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
haas:spring2017:cprog:projects:pnc0 [2017/02/14 19:50] – [Program] wedgehaas:spring2017:cprog:projects:pnc0 [2017/02/16 21:14] (current) – [brute force] wedge
Line 28: Line 28:
 The brute force approach is the simplest to implement (and likely also the worst-performing). We will use it as our baseline (it is nice to  have something to compare against). The brute force approach is the simplest to implement (and likely also the worst-performing). We will use it as our baseline (it is nice to  have something to compare against).
  
-To perform it, we simply attempt to evenly divide all the values between and the number in question. If any one of them divides evenly, the number is **NOT** prime, but instead a composite value.+To perform it, we simply attempt to evenly divide all the values between and one less than the number in question. If any one of them divides evenly, the number is **NOT** prime, but instead a composite value.
  
 Checking the remainder of a division indicates whether or not a division was clean (having 0 remainder indicates such a state). Checking the remainder of a division indicates whether or not a division was clean (having 0 remainder indicates such a state).
Line 101: Line 101:
  
 =====Command-Line Arguments===== =====Command-Line Arguments=====
-To automate our comparisons, we will be making use of command-line arguments in our programs. As we have yet to really get into arrays, I will provide you same code that you can use that will allow you to utilize them for the purposes of this project.+To automate our comparisons, we will be making use of command-line arguments in our programs. As we have yet to really get into arrays, I will provide you some code that you can use that will allow you to utilize them for the purposes of this project.
  
 ====header files==== ====header files====
Line 193: Line 193:
  
 ====Displaying the runtime==== ====Displaying the runtime====
-Once we having the starting and ending times, we can display this to STDERR. You'll want this line:+Once we have the starting and ending times, we can display this to STDERR. You'll want this line:
  
 <code c> <code c>
haas/spring2017/cprog/projects/pnc0.1487101804.txt.gz · Last modified: 2017/02/14 19:50 by wedge