Home

Download

Features

Screenshots

Handbook

Browse Source

Authors

SourceForge.net Logo
Hosted by SourceForge.net

OSI Certified


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages   Search  

fungmath.h

00001 /***************************************************************************
00002                           fungmath.h  -  description
00003                              -------------------
00004     begin                : Thu Nov 21 2002
00005     copyright            : (C) 2002-03 by Fungmeista
00006     email                : mizunoami44@users.sourceforge.net
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 #ifndef FUNGMATH_H
00018 #define FUNGMATH_H
00019 
00020 #define ROUND(a) (floor(a) - a < ceil(a) - a) ? floor(a) : ceil(a)
00021 #define ABS(a) ( a >= 0 ) ? a : a*(-1)
00022 #define MIN(a,b) ( a < b ) ? a : b;
00023 #define MAX(a,b) ( a > b ) ? a : b;
00024 
00025 #define itoa(value,str) sprintf((str),"%d",(value))
00026 #define dtoa(value,str) sprintf((str),"%.2f",(value))
00027 
00028 int num_digits( int i );
00029 
00030 int fibonacci( unsigned int );
00031 int factorial( unsigned int );
00032 int iRand( float, float );
00033 float fRand( float, float );
00034 
00035 #endif //FUNGMATH_H