File indexing completed on 2024-12-01 04:01:58

0001 /***************************************************************************
0002                           kimecommon.h  -  description
0003                              -------------------
0004     begin                : Thu Apr 23 2002
0005     copyright            : (C) 2002 by Jan Schäfer
0006     email                : janschaefer@users.sourceforge.net
0007  ***************************************************************************/
0008 
0009 /***************************************************************************
0010  *                                                                         *
0011  *   This program is free software; you can redistribute it and/or modify  *
0012  *   it under the terms of the GNU General Public License as published by  *
0013  *   the Free Software Foundation; either version 2 of the License, or     *
0014  *   (at your option) any later version.                                   *
0015  *                                                                         *
0016  ***************************************************************************/
0017 
0018 
0019 #ifndef __KIMECOMMON_H__
0020 #define __KIMECOMMON_H__
0021 
0022 inline int myabs(int i) {
0023     if (i < 0)
0024         return -i;
0025     else
0026         return i;
0027 }
0028 
0029 inline double myabs(double i) {
0030     if (i < 0)
0031         return -i;
0032     else
0033         return i;
0034 }
0035 
0036 inline int myround(double d) {
0037     if ( (d-((int) d)) < 0.5 )
0038         return (int) d;
0039     else
0040         return ((int) d)+1;
0041 }
0042 
0043 inline int roundUp(double d)
0044 {
0045   if ( (d-((int) d)) == 0)
0046      return (int) d;
0047   else
0048     return ((int) d)+1;
0049 }
0050 
0051 
0052 #endif