~ubuntu-branches/ubuntu/precise/gcalctool/precise-proposed

« back to all changes in this revision

Viewing changes to src/mp-trigonometric.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2011-02-01 14:37:04 UTC
  • mfrom: (1.3.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20110201143704-ipo3nv351hrcfrlf
Tags: 5.91.6-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include "mp.h"
26
26
#include "mp-private.h"
27
27
 
 
28
static MPNumber pi;
 
29
static gboolean have_pi = FALSE;
 
30
 
28
31
static int
29
32
mp_compare_mp_to_int(const MPNumber *x, int i)
30
33
{
64
67
void
65
68
mp_get_pi(MPNumber *z)
66
69
{
67
 
    mp_set_from_string("3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679", 10, z);
 
70
    if (mp_is_zero(&pi)) {
 
71
        mp_set_from_string("3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679", 10, &pi);
 
72
        have_pi = TRUE;
 
73
    }
 
74
    mp_set_from_mp(&pi, z);
68
75
}
69
76
 
70
77