after multiple objections of libtom users [1], we decided to change licensing
[libtomfloat.git] / mpf_mul.c
blobf79daeb4762af000b45e1d79ca06a4d0e5428d32
1 /* LibTomFloat, multiple-precision floating-point library
3 * LibTomFloat is a library that provides multiple-precision
4 * floating-point artihmetic as well as trigonometric functionality.
6 * This library requires the public domain LibTomMath to be installed.
7 *
8 * This library is free for all purposes without any express
9 * gurantee it works
11 * Tom St Denis, tomstdenis@iahu.ca, http://float.libtomcrypt.org
13 #include <tomfloat.h>
15 int mpf_mul(mp_float *a, mp_float *b, mp_float *c)
17 int err;
19 if ((err = mp_mul(&(a->mantissa), &(b->mantissa), &(c->mantissa))) != MP_OKAY) {
20 return err;
22 c->exp = a->exp + b->exp;
23 return mpf_normalize(c);