more simplification, got gtk.c under 3k lines
[gcalctool.git] / gcalctool / mpmath.h
blob69e0eaec3209627374a31947f42fc827fea0a2bf
2 /* $Header$
4 * Copyright (c) 1987-2007 Sun Microsystems, Inc. All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19 * 02111-1307, USA.
22 #ifndef MPMATH_H
23 #define MPMATH_H
25 #include "mp.h"
27 typedef unsigned long BOOLEAN;
29 /* function parameters: t=target, s=source) */
31 BOOLEAN ibool(double x);
32 double setbool(BOOLEAN p);
34 /* Trigonometric functions types */
35 enum trigfunc_type { sin_t, cos_t, tan_t, sinh_t, cosh_t, tanh_t,
36 asin_t, acos_t, atan_t, asinh_t, acosh_t, atanh_t };
38 int calc_trigfunc(enum trigfunc_type type, int s1[MP_SIZE], int t1[MP_SIZE]);
40 void mplog10(int *MPx, int *MPretval);
41 void calc_and(int t[MP_SIZE], int s1[MP_SIZE], int s2[MP_SIZE]);
42 void calc_or(int t[MP_SIZE], int s1[MP_SIZE], int s2[MP_SIZE]);
43 void calc_xor(int t[MP_SIZE], int s1[MP_SIZE], int s2[MP_SIZE]);
44 void calc_xnor(int t[MP_SIZE], int s1[MP_SIZE], int s2[MP_SIZE]);
45 void calc_not(int t[MP_SIZE], int s1[MP_SIZE]);
46 void calc_rand(int t[MP_SIZE]);
47 void calc_u32(int s1[MP_SIZE], int t1[MP_SIZE]);
48 void calc_u16(int s1[MP_SIZE], int t1[MP_SIZE]);
49 void calc_percent(int s1[MP_SIZE], int t1[MP_SIZE]);
50 void calc_inv(int s1[MP_SIZE], int t1[MP_SIZE]);
51 void calc_tenpowx(int s1[MP_SIZE], int t1[MP_SIZE]);
52 void calc_xpowy(int MPx[MP_SIZE], int MPy[MP_SIZE], int MPres[MP_SIZE]);
53 void do_zero(int t1[MP_SIZE]);
54 void do_e(int t1[MP_SIZE]);
55 void calc_xtimestenpowx(int s1[MP_SIZE], int s2[MP_SIZE], int t1[MP_SIZE]);
56 int calc_modulus(int op1[MP_SIZE], int op2[MP_SIZE], int result[MP_SIZE]);
57 void calc_ctrm(int t[MP_SIZE]);
58 void calc_ddb(int t[MP_SIZE]);
59 void calc_fv(int t[MP_SIZE]);
60 void calc_pmt(int t[MP_SIZE]);
61 void calc_pv(int t[MP_SIZE]);
62 void calc_rate(int t[MP_SIZE]);
63 void calc_sln(int t[MP_SIZE]);
64 void calc_syd(int t[MP_SIZE]);
65 void calc_term(int t[MP_SIZE]);
66 void calc_shift(int s[MP_SIZE], int t[MP_SIZE], int times);
67 void calc_epowy(int s[MP_SIZE], int t[MP_SIZE]);
69 /* return true if parameter is integer */
70 int
71 is_integer(int MPnum[MP_SIZE]);
73 /* return true if parameter is natural
74 number, that is, a positive integer
76 int
77 is_natural(int MPnum[MP_SIZE]);
79 #endif /*MPMATH_H*/