Support both μs and us for entering microseconds
[gcalctool.git] / src / mp-private.h
blob3211ea8455bf264b3d508b40519bde8fbabe5be7
1 /*
2 * Copyright (C) 1987-2008 Sun Microsystems, Inc. All Rights Reserved.
3 * Copyright (C) 2008-2009 Robert Ancell
5 * This program is free software: you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation, either version 2 of the License, or (at your option) any later
8 * version. See http://www.gnu.org/copyleft/gpl.html the full text of the
9 * license.
12 #ifndef MP_INTERNAL_H
13 #define MP_INTERNAL_H
15 #include <glib/gi18n.h>
17 /* If we're not using GNU C, elide __attribute__ */
18 #ifndef __GNUC__
19 # define __attribute__(x) /*NOTHING*/
20 #endif
22 #define min(a, b) ((a) <= (b) ? (a) : (b))
23 #define max(a, b) ((a) >= (b) ? (a) : (b))
25 //2E0 BELOW ENSURES AT LEAST ONE GUARD DIGIT
26 //MP.t = (int) ((float) (accuracy) * log((float)10.) / log((float) MP_BASE) + (float) 2.0);
27 //if (MP.t > MP_SIZE) {
28 // mperr("MP_SIZE TOO SMALL IN CALL TO MPSET, INCREASE MP_SIZE AND DIMENSIONS OF MP ARRAYS TO AT LEAST %d ***", MP.t);
29 // MP.t = MP_SIZE;
30 //}
31 #define MP_T 100
33 void mperr(const char *format, ...) __attribute__((format(printf, 1, 2)));
34 void mp_gcd(int64_t *, int64_t *);
35 void mp_normalize(MPNumber *);
36 void convert_to_radians(const MPNumber *x, MPAngleUnit unit, MPNumber *z);
37 void convert_from_radians(const MPNumber *x, MPAngleUnit unit, MPNumber *z);
39 #endif /* MP_INTERNAL_H */