QOF
0.8.7
|
Data Structures | |
struct | QofInt128 |
Functions | |
gboolean | equal128 (QofInt128 a, QofInt128 b) |
gint | cmp128 (QofInt128 a, QofInt128 b) |
QofInt128 | shift128 (QofInt128 x) |
QofInt128 | shiftleft128 (QofInt128 x) |
QofInt128 | inc128 (QofInt128 a) |
QofInt128 | add128 (QofInt128 a, QofInt128 b) |
QofInt128 | mult128 (gint64 a, gint64 b) |
QofInt128 | div128 (QofInt128 n, gint64 d) |
gint64 | rem128 (QofInt128 n, gint64 d) |
guint64 | gcf64 (guint64 num, guint64 denom) |
QofInt128 | lcm128 (guint64 a, guint64 b) |
Quick-n-dirty 128-bit integer math lib. Things seem to mostly work, and have been tested, but not comprehensively tested.
Add a pair of 128-bit numbers, returning a 128-bit number
Definition at line 308 of file qofmath128.c.
Divide a signed 128-bit number by a signed 64-bit, returning a signed 128-bit number.
Definition at line 180 of file qofmath128.c.
guint64 gcf64 | ( | guint64 | num, |
guint64 | denom | ||
) |
Return the greatest common factor of two 64-bit numbers
Definition at line 278 of file qofmath128.c.
QofInt128 lcm128 | ( | guint64 | a, |
guint64 | b | ||
) |
Return the least common multiple of two 64-bit numbers.
Definition at line 299 of file qofmath128.c.
QofInt128 mult128 | ( | gint64 | a, |
gint64 | b | ||
) |
Multiply a pair of signed 64-bit numbers, returning a signed 128-bit number.
Definition at line 41 of file qofmath128.c.
gint64 rem128 | ( | QofInt128 | n, |
gint64 | d | ||
) |
Return the remainder of a signed 128-bit number modulo a signed 64-bit. That is, return nd in 128-bit math. I beleive that ths algo is overflow-free, but should be audited some more ...
Definition at line 220 of file qofmath128.c.
Shift left by one bit (i.e. multiply by two)
Shift leftt by one bit (i.e. multiply by two)
Definition at line 131 of file qofmath128.c.