Changed mind about translating short currency names, instead use the full name in...
[gcalctool.git] / src / mp-private.h
blob94b153095d9f131aad5726d1e9e7730a4d3b1661
1 /* Copyright (c) 1987-2008 Sun Microsystems, Inc. All Rights Reserved.
2 * Copyright (c) 2008-2009 Robert Ancell
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2, or (at your option)
7 * any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17 * 02111-1307, USA.
20 #ifndef MP_INTERNAL_H
21 #define MP_INTERNAL_H
23 #include <glib/gi18n.h>
25 /* If we're not using GNU C, elide __attribute__ */
26 #ifndef __GNUC__
27 # define __attribute__(x) /*NOTHING*/
28 #endif
30 #define min(a, b) ((a) <= (b) ? (a) : (b))
31 #define max(a, b) ((a) >= (b) ? (a) : (b))
33 //2E0 BELOW ENSURES AT LEAST ONE GUARD DIGIT
34 //MP.t = (int) ((float) (accuracy) * log((float)10.) / log((float) MP_BASE) + (float) 2.0);
35 //if (MP.t > MP_SIZE) {
36 // mperr("MP_SIZE TOO SMALL IN CALL TO MPSET, INCREASE MP_SIZE AND DIMENSIONS OF MP ARRAYS TO AT LEAST %d ***", MP.t);
37 // MP.t = MP_SIZE;
38 //}
39 #define MP_T 100
41 void mperr(const char *format, ...) __attribute__((format(printf, 1, 2)));
42 void mp_gcd(int64_t *, int64_t *);
43 void mp_normalize(MPNumber *);
44 void convert_to_radians(const MPNumber *x, MPAngleUnit unit, MPNumber *z);
45 void convert_from_radians(const MPNumber *x, MPAngleUnit unit, MPNumber *z);
47 #endif /* MP_INTERNAL_H */