About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

sqrtrem.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include "gmp-impl.h"
#include "longlong.h"
Include dependency graph for sqrtrem.c:

Go to the source code of this file.


#define USE_DIVAPPR_Q   1
#define TRACE(x)
#define MAGIC   CNST_LIMB(0x10000000000) /* 0xffe7debbfc < MAGIC < 0x232b1850f410 */
#define Prec   (GMP_NUMB_BITS >> 1)
#define SQRTREM2_INPLACE   0
#define CALL_SQRTREM2_INPLACE(sp, rp)   mpn_sqrtrem2 (sp, rp, rp)


static mp_limb_t mpn_sqrtrem1 (mp_ptr rp, mp_limb_t a0)
static mp_limb_t mpn_sqrtrem2 (mp_ptr sp, mp_ptr rp, mp_srcptr np)
static mp_limb_t mpn_dc_sqrtrem (mp_ptr sp, mp_ptr np, mp_size_t n, mp_limb_t approx, mp_ptr scratch)
static void mpn_divappr_q (mp_ptr qp, mp_srcptr np, mp_size_t nn, mp_srcptr dp, mp_size_t dn, mp_ptr scratch)
static int mpn_dc_sqrt (mp_ptr sp, mp_srcptr np, mp_size_t n, unsigned nsh, unsigned odd)
mp_size_t __gmpn_sqrtrem (mp_ptr sp, mp_ptr rp, mp_srcptr np, mp_size_t nn)


static const unsigned char invsqrttab [384]

Macro Definition Documentation


#define CALL_SQRTREM2_INPLACE (   sp,
)    mpn_sqrtrem2 (sp, rp, rp)

Definition at line 182 of file sqrtrem.c.


#define MAGIC   CNST_LIMB(0x10000000000) /* 0xffe7debbfc < MAGIC < 0x232b1850f410 */

Definition at line 107 of file sqrtrem.c.

◆ Prec

#define Prec   (GMP_NUMB_BITS >> 1)

Definition at line 168 of file sqrtrem.c.


#define SQRTREM2_INPLACE   0

Definition at line 170 of file sqrtrem.c.


#define TRACE (   x)

Definition at line 50 of file sqrtrem.c.


#define USE_DIVAPPR_Q   1

Definition at line 49 of file sqrtrem.c.

Function Documentation

◆ __gmpn_sqrtrem()

◆ mpn_dc_sqrt()

◆ mpn_dc_sqrtrem()

◆ mpn_divappr_q()

◆ mpn_sqrtrem1()

static mp_limb_t mpn_sqrtrem1 ( mp_ptr  rp,
mp_limb_t  a0 

Definition at line 113 of file sqrtrem.c.

References a0, a1, abits, ASSERT, ASSERT_ALWAYS, CNST_LIMB, GMP_LIMB_BITS, GMP_NAIL_BITS, GMP_NUMB_HIGHBIT, invsqrttab, MAGIC, rp, t, t2, x0, and x2.

Referenced by __gmpn_sqrtrem(), and mpn_sqrtrem2().

◆ mpn_sqrtrem2()

static mp_limb_t mpn_sqrtrem2 ( mp_ptr  sp,
mp_ptr  rp,
mp_srcptr  np 

Definition at line 184 of file sqrtrem.c.

References ASSERT, CNST_LIMB, GMP_NUMB_HIGHBIT, GMP_NUMB_MASK, mpn_sqrtrem1(), np, Prec, q, q2, rp, sp, and u.

Referenced by __gmpn_sqrtrem().

Variable Documentation

◆ invsqrttab

const unsigned char invsqrttab[384]

Definition at line 52 of file sqrtrem.c.

Referenced by mpn_sqrtrem1().