-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprime.h
57 lines (46 loc) · 1.04 KB
/
prime.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* File: prime.h
* Author: pedro
*
* Created on March 19, 2010, 5:30 PM
*/
#ifndef _PRIME_H
#define _PRIME_H
#include <math.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* This holds the start and end of the prime calulations range.
*/
struct PrimeStartEnd {
int start;
int end;
};
/**
* Tests for prime number.
*
* @param num The number to test if it is a prime number.
* @return This will return true if it a prime false otherwise.
*/
int isPrime( int num );
/**
* Does the actual calculations of the odd consecutive
* numbers.
*
* @param primeStartEnd A struct that holds where to start
* and stop the calculatios of prime numbers.
* @return How many odd consecutive numbers there are.
*/
int do_work( struct PrimeStartEnd primeStartEnd );
/**
* Checks if a given number is odd or not.
*
* @param num The number to check if it is a odd number.
* @return True if it is a odd number.
*/
int is_odd( int num );
#ifdef __cplusplus
}
#endif
#endif /* _PRIME_H */