Bioplib
Protein Structure C Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
Functions
prime.c File Reference

Routines to identify prime numbers. More...

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include "SysDefs.h"
#include "MathUtil.h"

Go to the source code of this file.

Functions

ULONG blFindNextPrime (ULONG primeNum, BOOL above)
 
BOOL blIsPrime (ULONG input)
 

Detailed Description

Routines to identify prime numbers.

Version
V1.0
Date
15.05.15
Author
Dr. Andrew C. R. Martin
Institute of Structural & Molecular Biology, University College London, Gower Street, London. WC1E 6BT.
andre.nosp@m.w@bi.nosp@m.oinf..nosp@m.org..nosp@m.uk andre.nosp@m.w.ma.nosp@m.rtin@.nosp@m.ucl..nosp@m.ac.uk

This code is NOT IN THE PUBLIC DOMAIN, but it may be copied according to the conditions laid out in the accompanying file COPYING.DOC.

The code may be modified as required, but any modifications must be documented so that the person responsible can be identified.

The code may not be sold commercially or included as part of a commercial product except as described in the file COPYING.DOC.

Description:

Usage:

Revision History:

Definition in file prime.c.

Function Documentation

ULONG blFindNextPrime ( ULONG  primeNum,
BOOL  above 
)
Parameters
[in]primeNumInput number (prime or not)
[in]aboveAlways return a number above the input
Returns
The next prime

Returns a prime above (or equal to if 'above' is FALSE) the input number

  • 15.05.15 Original By: ACRM

Definition at line 97 of file prime.c.

BOOL blIsPrime ( ULONG  input)
Parameters
[in]inputNumber to test
Returns
Is this number a prime?

Tests whether the input number is a prime

  • 15.05.15 Original By: ACRM

Definition at line 142 of file prime.c.