kcalctype.h
1/*
2 $Id: kcalctype.h 466447 2005-10-02 17:54:10Z zander $
3
4 KCalc, a scientific calculator for the X window system using the
5 TQt widget libraries, available at no cost at http://www.troll.no
6
7 Copyright (C) 1996 Bernd Johannes Wuebben
8 wuebben@math.cornell.edu
9
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 * Boston, MA 02110-1301, USA.
24
25*/
26
27#ifdef HAVE_CONFIG_H
28#include "config.h"
29#endif
30
31#ifndef KCALC_TYPE_H
32#define KCALC_TYPE_H
33
34// The following for all the poor devels out there who don't have long double math.
35// I guess it's time to switch to LINUX guys .....
36
37// Undefine HAVE_LONG_DOUBLE for Beta 4 since RedHat 5.0 comes with a borken
38// glibc
39
40#ifdef HAVE_LONG_DOUBLE
41#undef HAVE_LONG_DOUBLE
42#endif
43
44#ifdef HAVE_LONG_DOUBLE
45
46/* should be detected by autoconf and defined in config.h
47 Be carefull when modifying these lines. HAVE_LONG_DOUBLE
48 is used all over kcalc's sources to determine whether
49 long double of double is the fundamental data type for kcalc*/
50
51
52
53#define CALCAMNT long double
54#else
55#define CALCAMNT double
56#endif
57
58
59#ifdef HAVE_LONG_DOUBLE
60#define FABS(X) fabsl(X)
61#define MODF(X,Y) modfl(X,Y)
62#define FMOD(X,Y) fmodl(X,Y)
63#define SIN(X) sinl(X)
64#define ASIN(X) asinl(X)
65#define SINH(X) sinhl(X)
66#define ASINH(X) asinhl(X)
67#define COS(X) cosl(X)
68#define COSH(X) coshl(X)
69#define ACOS(X) acosl(X)
70#define ACOSH(X) acoshl(X)
71#define TAN(X) tanl(X)
72#define TANH(X) tanhl(X)
73#define ATAN(X) atanl(X)
74#define ATANH(X) atanhl(X)
75#define EXP(X) expl(X)
76#define POW(X,Y) powl(X,Y)
77#define LOG(X) logl(X)
78#define LOG_TEN(X) log10l(X)
79#define SQRT(X) sqrtl(X)
80#else
81#define FABS(X) fabs(X)
82#define MODF(X,Y) modf(X,Y)
83#define FMOD(X,Y) fmod(X,Y)
84#define SIN(X) sin(X)
85#define ASIN(X) asin(X)
86#define SINH(X) sinh(X)
87#define ASINH(X) asinh(X)
88#define COS(X) cos(X)
89#define COSH(X) cosh(X)
90#define ACOS(X) acos(X)
91#define ACOSH(X) acosh(X)
92#define TAN(X) tan(X)
93#define TANH(X) tanh(X)
94#define ATAN(X) atan(X)
95#define ATANH(X) atanh(X)
96#define EXP(X) exp(X)
97#define POW(X,Y) pow(X,Y)
98#define LOG(X) log(X)
99#define LOG_TEN(X) log10(X)
100#define SQRT(X) sqrt(X)
101#endif
102
103
104#endif