From 05b5d261682b9136fb46476a64eab6980b0dba64 Mon Sep 17 00:00:00 2001 From: taw27 Date: Mon, 5 Feb 2007 21:12:57 +0000 Subject: Initial import git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@1 bf6ca9ba-c028-0410-8290-897cf20841d1 --- src/utils.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/utils.c (limited to 'src/utils.c') diff --git a/src/utils.c b/src/utils.c new file mode 100644 index 0000000..ce7c7f3 --- /dev/null +++ b/src/utils.c @@ -0,0 +1,44 @@ +/* + * utils.c + * + * Utility stuff + * + * (c) 2007 Thomas White + * dtr - Diffraction Tomography Reconstruction + * + */ + +#include + +/* Return the MOST POSITIVE of two numbers */ +unsigned int biggest(signed int a, signed int b) { + if ( a>b ) { + return a; + } + return b; +} + +/* Return the LEAST POSITIVE of two numbers */ +unsigned int smallest(signed int a, signed int b) { + if ( a