42 inline number
N()
const {
return _n;}
57 return nf(
k).
F() >= 0.0;
64 return nf(
nf(a).F() *
nf(
b).F()).
N();
162 return (0.0 ==
nf(a).F());
194 return nf(
nf(a).F() / n).
N();
207 return nf(1.0 / n).
N();
214 return nf(-
nf(c).F()).
N();
241 int n = sprintf(ch,
"%9.3e",
nf(a).F());
245 char* chbr =
new char[n+3];
246 memcpy(&chbr[2],&ch[1],n-1);
259static void nrPower (number a,
int i, number *
result,
const coeffs r)
279 static const char* nrEatr(
const char *
s,
SI_FLOAT *r)
283 if (*
s >=
'0' && *
s <=
'9')
292 while (*
s >=
'0' && *
s <=
'9');
304 static const char *nIllegalChar=
"illegal character in number";
314 if (
s==start) {
WerrorS(nIllegalChar);
return s; }
324 if (
s==start) {
WerrorS(nIllegalChar);
return s; }
327 while (*t >=
'0' && *t <=
'9')
333 z1 = (z1*n + z2) / n;
340 else if (*
s==
'-') {
s++; si=-1; }
341 while (*
s >=
'0' && *
s <=
'9')
348 while (e>0) {z1*=10.0; e--; }
352 while (e>0) {z1/=10.0; e--; }
369#pragma GCC diagnostic ignored "-Wunused-parameter"
383 int i = (int)((
long)from);
414#define SR_HDL(A) ((long)(A))
415#define IS_INT(A) ((A)->s==3)
416#define IS_IMM(A) (SR_HDL(A) & SR_INT)
417#define GET_NOM(A) ((A)->z)
418#define GET_DENOM(A) ((A)->n)
467 zz=(mpz_ptr)
omAlloc(
sizeof(mpz_t));
481 int sign= mpf_sgn(e);
496 basis = mpf_get_d_2exp(&
exp, e);
655 return (
char*)
"Float()";
679 n->cfExactDiv=
nrDiv;
gmp_complex numbers based on
Coefficient rings, fields and other domains suitable for Singular polynomials.
number ndCopyMap(number a, const coeffs src, const coeffs dst)
static FORCE_INLINE BOOLEAN nCoeff_is_long_R(const coeffs r)
@ n_R
single prescision (6,6) real numbers
@ n_long_R
real floating point (GMP) numbers
@ n_long_C
complex floating point (GMP) numbers
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
@ n_rep_gap_rat
(number), see longrat.h
@ n_rep_gap_gmp
(), see rinteger.h, new impl.
@ n_rep_float
(float), see shortfl.h
@ n_rep_int
(int), see modulop.h
@ n_rep_gmp_float
(gmp_float), see
@ n_rep_gmp_complex
(gmp_complex), see gnumpc.h
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
static FORCE_INLINE BOOLEAN nCoeff_is_R(const coeffs r)
static FORCE_INLINE BOOLEAN nCoeff_is_long_C(const coeffs r)
const CanonicalForm int s
const CanonicalForm int const CFList const Variable & y
void WerrorS(const char *s)
gmp_float exp(const gmp_float &a)
The main handler for Singular numbers which are suitable for Singular polynomials.
const char *const nDivBy0
#define SHORT_REAL_LENGTH
#define omFreeSize(addr, size)
void StringAppendS(const char *st)
static number nrSub(number a, number b, const coeffs r)
static const SI_FLOAT nrEps
static number nrMapQ(number from, const coeffs r, const coeffs aRing)
static number nrMult(number a, number b, const coeffs r)
SI_FLOAT nrFloat(number n)
Converts a n_R number into a float. Needed by Maps.
static char * nrCoeffName(const coeffs r)
static number nrMapC(number from, const coeffs aRing, const coeffs r)
BOOLEAN nrInitChar(coeffs n, void *p)
Initialize r.
static nMapFunc nrSetMap(const coeffs src, const coeffs dst)
Get a mapping function from src into the domain of this type: n_R.
static BOOLEAN nrDBTest(number a, const char *f, const int l, const coeffs r)
static number nrInvers(number c, const coeffs r)
static number nrDiv(number a, number b, const coeffs r)
static number nrAdd(number a, number b, const coeffs r)
static number nrNeg(number c, const coeffs r)
static number nrMapZ(number from, const coeffs aRing, const coeffs r)
static BOOLEAN nrEqual(number a, number b, const coeffs r)
static void nrWrite(number a, const coeffs r)
static char * nrCoeffString(const coeffs r)
static const char * nrRead(const char *s, number *a, const coeffs r)
static BOOLEAN nrIsZero(number a, const coeffs r)
static number nrInit(long i, const coeffs r)
static number nrMapP(number from, const coeffs aRing, const coeffs r)
static BOOLEAN nrGreater(number a, number b, const coeffs r)
static BOOLEAN nrIsMOne(number a, const coeffs r)
static BOOLEAN nrIsOne(number a, const coeffs r)
static number nrMapLongR(number from, const coeffs aRing, const coeffs r)
static long nrInt(number &n, const coeffs r)
static BOOLEAN nrGreaterZero(number k, const coeffs r)