1 /* TomsFastMath, a fast ISO C bignum library.
3 * This project is meant to fill in where LibTomMath
4 * falls short. That is speed ;-)
6 * This project is public domain and free for all purposes.
8 * Tom St Denis, tomstdenis@gmail.com
10 #include <tfm_private.h>
12 int fp_cmp(fp_int *a, fp_int *b)
14 if (a->sign == FP_NEG && b->sign == FP_ZPOS) {
16 } else if (a->sign == FP_ZPOS && b->sign == FP_NEG) {
20 if (a->sign == FP_NEG) {
21 /* if negative compare opposite direction */
22 return fp_cmp_mag(b, a);
24 return fp_cmp_mag(a, b);