QOF  0.8.7
qofmath128.h
1 /********************************************************************
2  * qofmath128.h -- an 128-bit integer library *
3  * Copyright (C) 2004 Linas Vepstas <linas@linas.org> *
4  * *
5  * This program is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU General Public License as *
7  * published by the Free Software Foundation; either version 2 of *
8  * the License, or (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License*
16  * along with this program; if not, contact: *
17  * *
18  * Free Software Foundation Voice: +1-617-542-5942 *
19  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
20  * Boston, MA 02110-1301, USA gnu@gnu.org *
21  * *
22  *******************************************************************/
23 
24 #ifndef QOF_MATH_128_H
25 #define QOF_MATH_128_H
26 
27 #include <glib.h>
28 
38 typedef struct
39 {
40  guint64 hi;
41  guint64 lo;
42  gshort isneg;
43  gshort isbig;
44 } QofInt128;
45 
47 gboolean equal128 (QofInt128 a, QofInt128 b);
48 
50 gint cmp128 (QofInt128 a, QofInt128 b);
51 
54 
57 
60 
63 
67 QofInt128 mult128 (gint64 a, gint64 b);
68 
72 QofInt128 div128 (QofInt128 n, gint64 d);
73 
79 gint64 rem128 (QofInt128 n, gint64 d);
80 
82 guint64 gcf64 (guint64 num, guint64 denom);
83 
85 QofInt128 lcm128 (guint64 a, guint64 b);
86 
89 #endif
guint64 gcf64(guint64 num, guint64 denom)
Definition: qofmath128.c:278
gshort isneg
Definition: qofmath128.h:42
QofInt128 inc128(QofInt128 a)
Definition: qofmath128.c:153
gint cmp128(QofInt128 a, QofInt128 b)
Definition: qofmath128.c:246
gint64 rem128(QofInt128 n, gint64 d)
Definition: qofmath128.c:220
QofInt128 shift128(QofInt128 x)
Definition: qofmath128.c:110
QofInt128 div128(QofInt128 n, gint64 d)
Definition: qofmath128.c:180
QofInt128 add128(QofInt128 a, QofInt128 b)
Definition: qofmath128.c:308
gboolean equal128(QofInt128 a, QofInt128 b)
Definition: qofmath128.c:233
QofInt128 shiftleft128(QofInt128 x)
Definition: qofmath128.c:131
gshort isbig
Definition: qofmath128.h:43
QofInt128 mult128(gint64 a, gint64 b)
Definition: qofmath128.c:41
QofInt128 lcm128(guint64 a, guint64 b)
Definition: qofmath128.c:299