Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

LinAlg/minmax.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 1992 Free Software Foundation
00003     written by Doug Lea (dl@rocky.oswego.edu)
00004 
00005 This file is part of the GNU C++ Library.  This library is free
00006 software; you can redistribute it and/or modify it under the terms of
00007 the GNU Library General Public License as published by the Free
00008 Software Foundation; either version 2 of the License, or (at your
00009 option) any later version.  This library is distributed in the hope
00010 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00011 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012 PURPOSE.  See the GNU Library General Public License for more details.
00013 You should have received a copy of the GNU Library General Public
00014 License along with this library; if not, write to the Free Software
00015 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
00016 */
00017 
00018 #ifndef _minmax_h
00019 #ifdef _GNUG_
00020 #pragma interface
00021 #endif
00022 #define _minmax_h 1
00023 
00024 namespace linalg 
00025 {
00026 
00027 inline char min(char a, char b) { return (a < b)?a:b;}
00028 #ifndef  _G_BROKEN_SIGNED_CHAR
00029 inline signed char min(signed char a, signed char b) { return (a < b)?a:b;}
00030 #endif
00031 inline unsigned char min(unsigned char a, unsigned char b) {return (a<b)?a:b;}
00032 
00033 inline short min(short a, short b) {return (a < b) ?a:b;}
00034 inline unsigned short min(unsigned short a, unsigned short b) {return (a < b)?a:b;}
00035 
00036 inline int min(int a, int b) {return (a < b)?a:b;}
00037 inline unsigned int min(unsigned int a, unsigned int b) {return (a < b)?a:b;}
00038 
00039 inline long min(long a, long b) {return (a < b)?a:b;}
00040 inline unsigned long min(unsigned long a, unsigned long b) {return (a<b)?a:b;}
00041 
00042 inline float min(float a, float b) {return (a < b)?a:b;}
00043 
00044 inline double min(double a, double b) {return (a < b)?a:b;}
00045 
00046 inline char max(char a, char b) { return (a > b)?a:b;}
00047 #ifndef  _G_BROKEN_SIGNED_CHAR
00048 inline signed char max(signed char a, signed char b) {return (a > b)?a:b;}
00049 #endif
00050 inline unsigned char max(unsigned char a, unsigned char b) {return (a>b)?a:b;}
00051 
00052 inline short max(short a, short b) {return (a > b) ?a:b;}
00053 inline unsigned short max(unsigned short a, unsigned short b) {return (a > b)?a:b;}
00054 
00055 inline int max(int a, int b) {return (a > b)?a:b;}
00056 inline unsigned int max(unsigned int a, unsigned int b) {return (a > b)?a:b;}
00057 
00058 inline long max(long a, long b) {return (a > b)?a:b;}
00059 inline unsigned long max(unsigned long a, unsigned long b) {return (a>b)?a:b;}
00060 
00061 inline float max(float a, float b) {return (a > b)?a:b;}
00062 
00063 inline double max(double a, double b) {return (a > b)?a:b;}
00064 
00065 #endif
00066 }

Generated on Wed Dec 15 21:20:29 2004 for vuVolume by  doxygen 1.3.9.1