}
/* }}} */
-static Bigint * Balloc(int k)
+static Bigint * Balloc(int k) /* {{{ */
{
int x;
Bigint *rv;
rv->sign = rv->wds = 0;
return rv;
}
+/* }}} */
-static void Bfree(Bigint *v)
+static void Bfree(Bigint *v) /* {{{ */
{
if (v) {
_THREAD_PRIVATE_MUTEX_LOCK(dtoa_mutex);
_THREAD_PRIVATE_MUTEX_UNLOCK(dtoa_mutex);
}
}
+/* }}} */
#define Bcopy(x,y) memcpy((char *)&x->sign, (char *)&y->sign, \
y->wds*sizeof(Long) + 2*sizeof(int))
/* return value is only used as a simple string, so mis-aligned parts
* inside the Bigint are not at risk on strict align architectures
*/
-static char * rv_alloc(int i) {
+static char * rv_alloc(int i) /* {{{ */
+{
int j, k, *r;
j = sizeof(ULong);
*r = k;
return (char *)(r+1);
}
+/* }}} */
-
-static char * nrv_alloc(char *s, char **rve, int n)
+static char * nrv_alloc(char *s, char **rve, int n) /* {{{ */
{
char *rv, *t;
}
return rv;
}
+/* }}} */
-static Bigint * multadd(Bigint *b, int m, int a) /* multiply by m and add a */
+static Bigint * multadd(Bigint *b, int m, int a) /* multiply by m and add a */ /* {{{ */
{
int i, wds;
ULong *x, y;
}
return b;
}
+/* }}} */
-static int hi0bits(ULong x)
+static int hi0bits(ULong x) /* {{{ */
{
int k = 0;
}
return k;
}
+/* }}} */
-static int lo0bits(ULong *y)
+static int lo0bits(ULong *y) /* {{{ */
{
int k;
ULong x = *y;
*y = x;
return k;
}
+/* }}} */
-static Bigint * i2b(int i)
+static Bigint * i2b(int i) /* {{{ */
{
Bigint *b;
b->wds = 1;
return b;
}
+/* }}} */
-static Bigint * mult(Bigint *a, Bigint *b)
+static Bigint * mult(Bigint *a, Bigint *b) /* {{{ */
{
Bigint *c;
int k, wa, wb, wc;
c->wds = wc;
return c;
}
+/* }}} */
-static Bigint * s2b (CONST char *s, int nd0, int nd, ULong y9)
+static Bigint * s2b (CONST char *s, int nd0, int nd, ULong y9) /* {{{ */
{
Bigint *b;
int i, k;
}
return b;
}
+/* }}} */
-static Bigint * pow5mult(Bigint *b, int k)
+static Bigint * pow5mult(Bigint *b, int k) /* {{{ */
{
Bigint *b1, *p5, *p51;
int i;
_THREAD_PRIVATE_MUTEX_UNLOCK(pow5mult_mutex);
return b;
}
+/* }}} */
-
-static Bigint *lshift(Bigint *b, int k)
+static Bigint *lshift(Bigint *b, int k) /* {{{ */
{
int i, k1, n, n1;
Bigint *b1;
Bfree(b);
return b1;
}
+/* }}} */
-static int cmp(Bigint *a, Bigint *b)
+static int cmp(Bigint *a, Bigint *b) /* {{{ */
{
ULong *xa, *xa0, *xb, *xb0;
int i, j;
}
return 0;
}
+/* }}} */
-
-static Bigint * diff(Bigint *a, Bigint *b)
+static Bigint * diff(Bigint *a, Bigint *b) /* {{{ */
{
Bigint *c;
int i, wa, wb;
c->wds = wa;
return c;
}
+/* }}} */
-static double ulp (double _x)
+static double ulp (double _x) /* {{{ */
{
_double x;
register Long L;
#endif
return value(a);
}
+/* }}} */
+/* static double b2d () {{{ */
static double
b2d
#ifdef KR_headers
#endif
return value(d);
}
+/* }}} */
-
-static Bigint * d2b(double _d, int *e, int *bits)
+static Bigint * d2b(double _d, int *e, int *bits) /* {{{ */
{
Bigint *b;
int de, i, k;
#endif
return b;
}
+/* }}} */
+
#undef d0
#undef d1
-
-static double ratio (Bigint *a, Bigint *b)
+static double ratio (Bigint *a, Bigint *b) /* {{{ */
{
_double da, db;
int k, ka, kb;
#endif
return value(da) / value(db);
}
+/* }}} */
static CONST double
tens[] = {
#endif
#endif
-
-static int quorem(Bigint *b, Bigint *S)
+static int quorem(Bigint *b, Bigint *S) /* {{{ */
{
int n;
Long borrow, y;
}
return q;
}
+/* }}} */
-static void destroy_freelist(void)
+static void destroy_freelist(void) /* {{{ */
{
int i;
Bigint *tmp;
_THREAD_PRIVATE_MUTEX_UNLOCK(dtoa_mutex);
}
+/* }}} */
-
-ZEND_API void zend_freedtoa(char *s)
+ZEND_API void zend_freedtoa(char *s) /* {{{ */
{
Bigint *b = (Bigint *)((int *)s - 1);
b->maxwds = 1 << (b->k = *(int*)b);
Bfree(b);
}
+/* }}} */
/* dtoa for IEEE arithmetic (dmg): convert double to ASCII string.
*
* calculation.
*/
-ZEND_API char * zend_dtoa(double _d, int mode, int ndigits, int *decpt, int *sign, char **rve)
+ZEND_API char * zend_dtoa(double _d, int mode, int ndigits, int *decpt, int *sign, char **rve) /* {{{ */
{
/* Arguments ndigits, decpt, sign are similar to those
of ecvt and fcvt; trailing zeros are suppressed from
*rve = s;
return s0;
}
+/* }}} */
-ZEND_API double zend_strtod (CONST char *s00, char **se)
+ZEND_API double zend_strtod (CONST char *s00, char **se) /* {{{ */
{
int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign,
e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign;
return result;
}
+/* }}} */
-ZEND_API double zend_u_strtod(const UChar *nptr, UChar **endptr)
+ZEND_API double zend_u_strtod(const UChar *nptr, UChar **endptr) /* {{{ */
{
const UChar *u = nptr, *nstart;
UChar c = *u;
return 0;
}
+/* }}} */
/*
* Local variables: