//****************************************************************// // Title: my-math.h // Description: template functions for simple math things // assumes that > is defined for any class this will be used for // // created because math.h conflicted with enception header // // Functions: // myabs - returns absolute value of the object // // Author: Dr Michael A. Redmond // Date: 4/14/97 // Last Revised Date: 4/14/97 // // // Copyright (c) 1997. Dr. Michael A. Redmond // This software may not be distributed further without permission from // Dr Michael A. Redmond. // This software is distributed WITHOUT ANY WARRANTY. // //****************************************************************// // conditional compilation to avoid trying to include same thing twice #ifndef MY_MATH_H #define MY_MATH_H #include // get absolute value // intended mainly for the various numeric builtin types // template function rather than in class template T myabs (T object){ if (object < 0) { return -object; } else return object; } #endif