Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: e7812b59bb
Fetching contributors…

Cannot retrieve contributors at this time

file 30 lines (26 sloc) 0.764 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
/* LibTomFloat, multiple-precision floating-point library
*
* LibTomFloat is a library that provides multiple-precision
* floating-point artihmetic as well as trigonometric functionality.
*
* This library requires the public domain LibTomMath to be installed.
*
* This library is free for all purposes without any express
* gurantee it works
*
* Tom St Denis, tomstdenis@iahu.ca, http://float.libtomcrypt.org
*/
#include <tomfloat.h>

int mpf_add_d(mp_float *a, long b, mp_float *c)
{
   int err;
   mp_float tmp;

   if ((err = mpf_init(&tmp, c->radix)) != MP_OKAY) {
      return err;
   }

   if ((err = mpf_const_d(&tmp, b)) != MP_OKAY) { goto __ERR; }
   err = mpf_add(a, &tmp, c);

__ERR:
   mpf_clear(&tmp);
   return err;
}
Something went wrong with that request. Please try again.