~ubuntu-branches/ubuntu/intrepid/ecl/intrepid

« back to all changes in this revision

Viewing changes to src/gmp/mpf/iset_d.c

  • Committer: Bazaar Package Importer
  • Author(s): Peter Van Eynde
  • Date: 2007-04-09 11:51:51 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070409115151-ql8cr0kalzx1jmla
Tags: 0.9i-20070324-2
Upload to unstable. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* mpf_init_set_d -- Initialize a float and assign it from a double.
2
2
 
3
 
Copyright 1993, 1994, 1995, 2000, 2001 Free Software Foundation, Inc.
 
3
Copyright 1993, 1994, 1995, 2000, 2001, 2004 Free Software Foundation, Inc.
4
4
 
5
5
This file is part of the GNU MP Library.
6
6
 
16
16
 
17
17
You should have received a copy of the GNU Lesser General Public License
18
18
along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
19
 
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20
 
MA 02111-1307, USA. */
 
19
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
20
MA 02110-1301, USA. */
21
21
 
22
22
#include "gmp.h"
23
23
#include "gmp-impl.h"
26
26
mpf_init_set_d (mpf_ptr r, double val)
27
27
{
28
28
  mp_size_t prec = __gmp_default_fp_limb_precision;
 
29
  r->_mp_prec = prec;
29
30
  r->_mp_d = (mp_ptr) (*__gmp_allocate_func) ((prec + 1) * BYTES_PER_MP_LIMB);
30
 
  r->_mp_prec = prec;
31
31
 
32
32
  mpf_set_d (r, val);
33
33
}