My Project
Data Structures | Functions
gnumpfl.cc File Reference
#include "misc/auxiliary.h"
#include "reporter/reporter.h"
#include "coeffs/coeffs.h"
#include "coeffs/numbers.h"
#include "coeffs/mpr_complex.h"
#include "coeffs/longrat.h"
#include "coeffs/shortfl.h"
#include "coeffs/gnumpfl.h"
#include "coeffs/gnumpc.h"
#include "coeffs/modulop.h"

Go to the source code of this file.

Data Structures

union  nf
 

Functions

const char * ngfRead (const char *s, number *a, const coeffs r)
 
static number ngfInit (long i, const coeffs r)
 
static long ngfInt (number &i, const coeffs r)
 
static BOOLEAN ngfIsZero (number a, const coeffs r)
 
static int ngfSize (number n, const coeffs r)
 
static void ngfDelete (number *a, const coeffs r)
 
static number ngfCopy (number a, const coeffs r)
 
static number ngfNeg (number a, const coeffs r)
 
static number ngfInvers (number a, const coeffs r)
 
static number ngfAdd (number a, number b, const coeffs R)
 
static number ngfSub (number a, number b, const coeffs R)
 
static number ngfMult (number a, number b, const coeffs R)
 
static number ngfDiv (number a, number b, const coeffs r)
 
static number ngfPower (number x, int exp, const coeffs r)
 
static void ngfPower (number x, int exp, number *u, const coeffs r)
 
static BOOLEAN ngfGreaterZero (number a, const coeffs r)
 
static BOOLEAN ngfGreater (number a, number b, const coeffs r)
 
static BOOLEAN ngfEqual (number a, number b, const coeffs r)
 
static BOOLEAN ngfIsOne (number a, const coeffs r)
 
static BOOLEAN ngfIsMOne (number a, const coeffs r)
 
static char * ngfEatFloatNExp (char *s)
 
static void ngfWrite (number a, const coeffs r)
 
static BOOLEAN ngfCoeffIsEqual (const coeffs r, n_coeffType n, void *parameter)
 
static void ngfSetChar (const coeffs r)
 
static char * ngfCoeffName (const coeffs r)
 
static number ngfMapQ (number from, const coeffs src, const coeffs dst)
 
static number ngfMapZ (number from, const coeffs aRing, const coeffs r)
 
static number ngfMapR (number from, const coeffs src, const coeffs dst)
 
static number ngfMapP (number from, const coeffs src, const coeffs dst)
 
static number ngfMapC (number from, const coeffs src, const coeffs dst)
 
static number ngfInitMPZ (mpz_t m, const coeffs)
 
static nMapFunc ngfSetMap (const coeffs src, const coeffs dst)
 
BOOLEAN ngfInitChar (coeffs n, void *parameter)
 Initialize r. More...
 

Function Documentation

◆ ngfAdd()

static number ngfAdd ( number  a,
number  b,
const coeffs  R 
)
static

Definition at line 153 of file gnumpfl.cc.

154{
156
157 gmp_float* r= new gmp_float( (*(gmp_float*)a) + (*(gmp_float*)b) );
158 return (number)r;
159}
CanonicalForm b
Definition: cfModGcd.cc:4105
@ n_long_R
real floating point (GMP) numbers
Definition: coeffs.h:34
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:422
#define assume(x)
Definition: mod2.h:387
#define R
Definition: sirandom.c:27

◆ ngfCoeffIsEqual()

static BOOLEAN ngfCoeffIsEqual ( const coeffs  r,
n_coeffType  n,
void *  parameter 
)
static

Definition at line 389 of file gnumpfl.cc.

390{
391 if (n==n_long_R)
392 {
393 LongComplexInfo* p = (LongComplexInfo *)(parameter);
394 if ((p!=NULL)
395 && (p->float_len == r->float_len)
396 && (p->float_len2 == r->float_len2))
397 return TRUE;
398 }
399 return FALSE;
400}
#define NULL
Definition: auxiliary.h:104
#define TRUE
Definition: auxiliary.h:100
#define FALSE
Definition: auxiliary.h:96
int p
Definition: cfModGcd.cc:4080

◆ ngfCoeffName()

static char * ngfCoeffName ( const coeffs  r)
static

Definition at line 407 of file gnumpfl.cc.

408{
409 STATIC_VAR char ngfCoeffName_buf[30];
410 snprintf(ngfCoeffName_buf,30,"Float(%d,%d)",r->float_len,r->float_len2);
411 return ngfCoeffName_buf;
412}
#define STATIC_VAR
Definition: globaldefs.h:7

◆ ngfCopy()

static number ngfCopy ( number  a,
const coeffs  r 
)
static

Definition at line 96 of file gnumpfl.cc.

97{
99
100 gmp_float* b= new gmp_float( *(gmp_float*)a );
101 return (number)b;
102}

◆ ngfDelete()

static void ngfDelete ( number *  a,
const coeffs  r 
)
static

Definition at line 82 of file gnumpfl.cc.

83{
85
86 if ( *a != NULL )
87 {
88 delete *(gmp_float**)a;
89 *a=NULL;
90 }
91}

◆ ngfDiv()

static number ngfDiv ( number  a,
number  b,
const coeffs  r 
)
static

Definition at line 186 of file gnumpfl.cc.

187{
189
190 gmp_float* f;
191 if ( ((gmp_float*)b)->isZero() )
192 {
193 // a/0 = error
195 f= new gmp_float( 0 );
196 }
197 else
198 {
199 f= new gmp_float( (*(gmp_float*)a) / (*(gmp_float*)b) );
200 }
201 return (number)f;
202}
f
Definition: cfModGcd.cc:4083
bool isZero(const CFArray &A)
checks if entries of A are zero
void WerrorS(const char *s)
Definition: feFopen.cc:24
const char *const nDivBy0
Definition: numbers.h:87

◆ ngfEatFloatNExp()

static char * ngfEatFloatNExp ( char *  s)
static

Definition at line 283 of file gnumpfl.cc.

284{
285 char *start= s;
286
287 // eat floats (mantissa) like:
288 // 0.394394993, 102.203003008, .300303032, pssibly starting with -
289 if (*s == '-') s++;
290 while ((*s >= '0' && *s <= '9')||(*s == '.')) s++;
291
292 // eat the exponent, starts with 'e' followed by '+', '-'
293 // and digits, like:
294 // e-202, e+393, accept also E7
295 if ( (s != start) && ((*s == 'e')||(*s=='E')))
296 {
297 if (*s=='E') *s='e';
298 s++; // skip 'e'/'E'
299 if ((*s == '+') || (*s == '-')) s++;
300 while ((*s >= '0' && *s <= '9')) s++;
301 }
302
303 return s;
304}
const CanonicalForm int s
Definition: facAbsFact.cc:51

◆ ngfEqual()

static BOOLEAN ngfEqual ( number  a,
number  b,
const coeffs  r 
)
static

Definition at line 256 of file gnumpfl.cc.

257{
259
260 return ( (*(gmp_float*)a) == (*(gmp_float*)b) );
261}

◆ ngfGreater()

static BOOLEAN ngfGreater ( number  a,
number  b,
const coeffs  r 
)
static

Definition at line 246 of file gnumpfl.cc.

247{
249
250 return ( (*(gmp_float*)a) > (*(gmp_float*)b) );
251}

◆ ngfGreaterZero()

static BOOLEAN ngfGreaterZero ( number  a,
const coeffs  r 
)
static

Definition at line 236 of file gnumpfl.cc.

237{
239
240 return (((gmp_float*)a)->sign() > 0);
241}
int sign(const CanonicalForm &a)

◆ ngfInit()

static number ngfInit ( long  i,
const coeffs  r 
)
static

Definition at line 39 of file gnumpfl.cc.

40{
42
43 gmp_float* n= new gmp_float( (double)i );
44 return (number)n;
45}
int i
Definition: cfEzgcd.cc:132

◆ ngfInitChar()

BOOLEAN ngfInitChar ( coeffs  n,
void *  parameter 
)

Initialize r.

Definition at line 506 of file gnumpfl.cc.

507{
509
510 n->is_field=TRUE;
511 n->is_domain=TRUE;
512 n->rep=n_rep_gmp_float;
513
514 //n->cfKillChar = ndKillChar; /* dummy */
515
516 n->cfSetChar = ngfSetChar;
517 n->ch = 0;
518 n->cfCoeffName=ngfCoeffName;
519
520 n->cfDelete = ngfDelete;
521 //n->cfNormalize=ndNormalize;
522 n->cfInit = ngfInit;
523 n->cfInitMPZ = ngfInitMPZ;
524 n->cfInt = ngfInt;
525 n->cfAdd = ngfAdd;
526 n->cfSub = ngfSub;
527 n->cfMult = ngfMult;
528 n->cfDiv = ngfDiv;
529 n->cfExactDiv= ngfDiv;
530 n->cfInpNeg = ngfNeg;
531 n->cfInvers = ngfInvers;
532 n->cfCopy = ngfCopy;
533 n->cfGreater = ngfGreater;
534 n->cfEqual = ngfEqual;
535 n->cfIsZero = ngfIsZero;
536 n->cfIsOne = ngfIsOne;
537 n->cfIsMOne = ngfIsMOne;
538 n->cfGreaterZero = ngfGreaterZero;
539 n->cfWriteLong = ngfWrite;
540 n->cfRead = ngfRead;
541 n->cfPower = ngfPower;
542 n->cfSetMap = ngfSetMap;
543#ifdef LDEBUG
544 //n->cfDBTest = ndDBTest; // not yet implemented: ngfDBTest
545#endif
546
547 n->nCoeffIsEqual = ngfCoeffIsEqual;
548
549 if( parameter != NULL)
550 {
551 LongComplexInfo* p = (LongComplexInfo*)parameter;
552
553 n->float_len = p->float_len;
554 n->float_len2 = p->float_len2;
555 } else // default values, just for testing!
556 {
557 n->float_len = SHORT_REAL_LENGTH;
558 n->float_len2 = SHORT_REAL_LENGTH;
559 }
560
561 assume( n->float_len2 >= SHORT_REAL_LENGTH );
562
563 assume( n_NumberOfParameters(n) == 0 );
565
566 return FALSE;
567}
static FORCE_INLINE char const ** n_ParameterNames(const coeffs r)
Returns a (const!) pointer to (const char*) names of parameters.
Definition: coeffs.h:802
static FORCE_INLINE int n_NumberOfParameters(const coeffs r)
Returns the number of parameters.
Definition: coeffs.h:798
@ n_rep_gmp_float
(gmp_float), see
Definition: coeffs.h:118
static number ngfInit(long i, const coeffs r)
Definition: gnumpfl.cc:39
static number ngfCopy(number a, const coeffs r)
Definition: gnumpfl.cc:96
static BOOLEAN ngfGreater(number a, number b, const coeffs r)
Definition: gnumpfl.cc:246
static void ngfSetChar(const coeffs r)
Definition: gnumpfl.cc:402
static number ngfInvers(number a, const coeffs r)
Definition: gnumpfl.cc:133
static long ngfInt(number &i, const coeffs r)
Definition: gnumpfl.cc:50
static number ngfInitMPZ(mpz_t m, const coeffs)
Definition: gnumpfl.cc:469
static number ngfDiv(number a, number b, const coeffs r)
Definition: gnumpfl.cc:186
static number ngfAdd(number a, number b, const coeffs R)
Definition: gnumpfl.cc:153
static BOOLEAN ngfGreaterZero(number a, const coeffs r)
Definition: gnumpfl.cc:236
static BOOLEAN ngfIsMOne(number a, const coeffs r)
Definition: gnumpfl.cc:276
static BOOLEAN ngfIsZero(number a, const coeffs r)
Definition: gnumpfl.cc:61
static void ngfWrite(number a, const coeffs r)
Definition: gnumpfl.cc:371
static number ngfPower(number x, int exp, const coeffs r)
Definition: gnumpfl.cc:207
static BOOLEAN ngfEqual(number a, number b, const coeffs r)
Definition: gnumpfl.cc:256
static void ngfDelete(number *a, const coeffs r)
Definition: gnumpfl.cc:82
const char * ngfRead(const char *s, number *a, const coeffs r)
Definition: gnumpfl.cc:312
static BOOLEAN ngfCoeffIsEqual(const coeffs r, n_coeffType n, void *parameter)
Definition: gnumpfl.cc:389
static number ngfNeg(number a, const coeffs r)
Definition: gnumpfl.cc:122
static BOOLEAN ngfIsOne(number a, const coeffs r)
Definition: gnumpfl.cc:266
static number ngfMult(number a, number b, const coeffs R)
Definition: gnumpfl.cc:175
static nMapFunc ngfSetMap(const coeffs src, const coeffs dst)
Definition: gnumpfl.cc:475
static char * ngfCoeffName(const coeffs r)
Definition: gnumpfl.cc:407
static number ngfSub(number a, number b, const coeffs R)
Definition: gnumpfl.cc:164
#define SHORT_REAL_LENGTH
Definition: numbers.h:57

◆ ngfInitMPZ()

static number ngfInitMPZ ( mpz_t  m,
const  coeffs 
)
static

Definition at line 469 of file gnumpfl.cc.

470{
471 gmp_float *res=new gmp_float(m);
472 return (number)res;
473}
int m
Definition: cfEzgcd.cc:128
CanonicalForm res
Definition: facAbsFact.cc:60

◆ ngfInt()

static long ngfInt ( number &  i,
const coeffs  r 
)
static

Definition at line 50 of file gnumpfl.cc.

51{
53
54 double d=(double)*(gmp_float*)i;
55 if (d<0.0)
56 return (long)(d-0.5);
57 else
58 return (long)(d+0.5);
59}

◆ ngfInvers()

static number ngfInvers ( number  a,
const coeffs  r 
)
static

Definition at line 133 of file gnumpfl.cc.

134{
136
137 gmp_float* f= NULL;
138 if (((gmp_float*)a)->isZero() )
139 {
141 f= new gmp_float( 0 );
142 }
143 else
144 {
145 f= new gmp_float( gmp_float(1) / (*(gmp_float*)a) );
146 }
147 return (number)f;
148}

◆ ngfIsMOne()

static BOOLEAN ngfIsMOne ( number  a,
const coeffs  r 
)
static

Definition at line 276 of file gnumpfl.cc.

277{
279
280 return ((gmp_float*)a)->isMOne();
281}

◆ ngfIsOne()

static BOOLEAN ngfIsOne ( number  a,
const coeffs  r 
)
static

Definition at line 266 of file gnumpfl.cc.

267{
269
270 return ((gmp_float*)a)->isOne();
271}

◆ ngfIsZero()

static BOOLEAN ngfIsZero ( number  a,
const coeffs  r 
)
static

Definition at line 61 of file gnumpfl.cc.

62{
64
65 return ( ((gmp_float*)a)->isZero() );
66}

◆ ngfMapC()

static number ngfMapC ( number  from,
const coeffs  src,
const coeffs  dst 
)
static

Definition at line 460 of file gnumpfl.cc.

461{
462 assume( getCoeffType(dst) == n_long_R );
463 assume( getCoeffType(src) == n_long_C );
464
465 gmp_float *res=new gmp_float(((gmp_complex*)from)->real());
466 return (number)res;
467}
gmp_complex numbers based on
Definition: mpr_complex.h:179
@ n_long_C
complex floating point (GMP) numbers
Definition: coeffs.h:42

◆ ngfMapP()

static number ngfMapP ( number  from,
const coeffs  src,
const coeffs  dst 
)
static

Definition at line 452 of file gnumpfl.cc.

453{
454 assume( getCoeffType(dst) == n_long_R );
455 assume( getCoeffType(src) == n_Zp );
456
457 return ngfInit(npInt(from,src), dst); // FIXME? TODO? // extern int npInt (number &n, const coeffs r);
458}
@ n_Zp
\F{p < 2^31}
Definition: coeffs.h:30
long npInt(number &n, const coeffs r)
Definition: modulop.cc:85

◆ ngfMapQ()

static number ngfMapQ ( number  from,
const coeffs  src,
const coeffs  dst 
)
static

Definition at line 414 of file gnumpfl.cc.

415{
416 assume( getCoeffType(dst) == n_long_R );
417 assume( src->rep == n_rep_gap_rat );
418
420 return (number)res;
421}
@ n_rep_gap_rat
(number), see longrat.h
Definition: coeffs.h:112
gmp_float numberFieldToFloat(number num, int cf)
Definition: mpr_complex.cc:438
#define QTOF
Definition: mpr_complex.h:19

◆ ngfMapR()

static number ngfMapR ( number  from,
const coeffs  src,
const coeffs  dst 
)
static

Definition at line 443 of file gnumpfl.cc.

444{
445 assume( getCoeffType(dst) == n_long_R );
446 assume( getCoeffType(src) == n_R );
447
448 gmp_float *res=new gmp_float((double)nf(from).F());
449 return (number)res;
450}
@ n_R
single prescision (6,6) real numbers
Definition: coeffs.h:32
Definition: gnumpfl.cc:27

◆ ngfMapZ()

static number ngfMapZ ( number  from,
const coeffs  aRing,
const coeffs  r 
)
static

Definition at line 422 of file gnumpfl.cc.

423{
425 assume( aRing->rep == n_rep_gap_gmp);
426
427 if ( from != NULL )
428 {
429 if (SR_HDL(from) & SR_INT)
430 {
431 gmp_float f_i= gmp_float(SR_TO_INT(from));
432 gmp_float *res=new gmp_float(f_i);
433 return (number)res;
434 }
435 gmp_float f_i=(mpz_ptr)from;
436 gmp_float *res=new gmp_float(f_i);
437 return (number)res;
438 }
439 else
440 return NULL;
441}
@ n_rep_gap_gmp
(), see rinteger.h, new impl.
Definition: coeffs.h:113
#define SR_INT
Definition: longrat.h:67
#define SR_TO_INT(SR)
Definition: longrat.h:69
#define SR_HDL(A)
Definition: tgb.cc:35

◆ ngfMult()

static number ngfMult ( number  a,
number  b,
const coeffs  R 
)
static

Definition at line 175 of file gnumpfl.cc.

176{
178
179 gmp_float* r= new gmp_float( (*(gmp_float*)a) * (*(gmp_float*)b) );
180 return (number)r;
181}

◆ ngfNeg()

static number ngfNeg ( number  a,
const coeffs  r 
)
static

Definition at line 122 of file gnumpfl.cc.

123{
125
126 *(gmp_float*)a= -(*(gmp_float*)a);
127 return (number)a;
128}

◆ ngfPower() [1/2]

static number ngfPower ( number  x,
int  exp,
const coeffs  r 
)
static

Definition at line 207 of file gnumpfl.cc.

208{
210
211 if ( exp == 0 )
212 {
213 gmp_float* n = new gmp_float(1);
214 return (number)n;
215 }
216 else if ( ngfIsZero(x, r) ) // 0^e, e>0
217 {
218 return ngfInit(0, r);
219 }
220 else if ( exp == 1 )
221 {
222 return ngfCopy(x,r);
223 }
224 return (number) ( new gmp_float( (*(gmp_float*)x)^exp ) );
225}
Variable x
Definition: cfModGcd.cc:4084
gmp_float exp(const gmp_float &a)
Definition: mpr_complex.cc:357

◆ ngfPower() [2/2]

static void ngfPower ( number  x,
int  exp,
number *  u,
const coeffs  r 
)
static

Definition at line 228 of file gnumpfl.cc.

229{
230 *u = ngfPower(x, exp, r);
231}

◆ ngfRead()

const char * ngfRead ( const char *  s,
number *  a,
const coeffs  r 
)

Definition at line 312 of file gnumpfl.cc.

313{
315
316 char *s= (char *)start;
317
318 //Print("%s\n",s);
319
320 s= ngfEatFloatNExp( s );
321
322 if (*s=='\0') // 0
323 {
324 if ( *(gmp_float**)a == NULL ) (*(gmp_float**)a)= new gmp_float();
325 (*(gmp_float**)a)->setFromStr(start);
326 }
327 else if (s==start) // 1
328 {
329 if ( *(gmp_float**)a != NULL ) delete (*(gmp_float**)a);
330 (*(gmp_float**)a)= new gmp_float(1);
331 }
332 else
333 {
334 gmp_float divisor(1.0);
335 char *start2=s;
336 if ( *s == '/' )
337 {
338 s++;
339 s= ngfEatFloatNExp( (char *)s );
340 if (s!= start2+1)
341 {
342 char tmp_c=*s;
343 *s='\0';
344 divisor.setFromStr(start2+1);
345 *s=tmp_c;
346 }
347 else
348 {
349 Werror("wrong long real format: %s",start2);
350 }
351 }
352 char c=*start2;
353 *start2='\0';
354 if ( *(gmp_float**)a == NULL ) (*(gmp_float**)a)= new gmp_float();
355 (*(gmp_float**)a)->setFromStr(start);
356 *start2=c;
357 if (divisor.isZero())
358 {
360 }
361 else
362 (**(gmp_float**)a) /= divisor;
363 }
364
365 return s;
366}
static char * ngfEatFloatNExp(char *s)
Definition: gnumpfl.cc:283
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ ngfSetChar()

static void ngfSetChar ( const coeffs  r)
static

Definition at line 402 of file gnumpfl.cc.

403{
404 setGMPFloatDigits(r->float_len, r->float_len2);
405}
void setGMPFloatDigits(size_t digits, size_t rest)
Set size of mantissa digits - the number of output digits (basis 10) the size of mantissa consists of...
Definition: mpr_complex.cc:60

◆ ngfSetMap()

static nMapFunc ngfSetMap ( const coeffs  src,
const coeffs  dst 
)
static

Definition at line 475 of file gnumpfl.cc.

476{
477 assume( getCoeffType(dst) == n_long_R );
478
479 if (src->rep==n_rep_gap_rat) /*Q, Z*/
480 {
481 return ngfMapQ;
482 }
483 if (src->rep==n_rep_gap_gmp) /*Q, Z*/
484 {
485 return ngfMapZ;
486 }
487 if ((src->rep==n_rep_gmp_float) && nCoeff_is_long_R(src))
488 {
489 return ndCopyMap; //ngfCopyMap;
490 }
491 if ((src->rep==n_rep_float) && nCoeff_is_R(src))
492 {
493 return ngfMapR;
494 }
495 if ((src->rep==n_rep_gmp_complex) && nCoeff_is_long_C(src))
496 {
497 return ngfMapC;
498 }
499 if ((src->rep==n_rep_int) && nCoeff_is_Zp(src))
500 {
501 return ngfMapP;
502 }
503 return NULL;
504}
number ndCopyMap(number a, const coeffs src, const coeffs dst)
Definition: numbers.cc:259
static FORCE_INLINE BOOLEAN nCoeff_is_long_R(const coeffs r)
Definition: coeffs.h:915
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
Definition: coeffs.h:824
@ n_rep_float
(float), see shortfl.h
Definition: coeffs.h:117
@ n_rep_int
(int), see modulop.h
Definition: coeffs.h:111
@ n_rep_gmp_complex
(gmp_complex), see gnumpc.h
Definition: coeffs.h:119
static FORCE_INLINE BOOLEAN nCoeff_is_R(const coeffs r)
Definition: coeffs.h:860
static FORCE_INLINE BOOLEAN nCoeff_is_long_C(const coeffs r)
Definition: coeffs.h:918
static number ngfMapC(number from, const coeffs src, const coeffs dst)
Definition: gnumpfl.cc:460
static number ngfMapZ(number from, const coeffs aRing, const coeffs r)
Definition: gnumpfl.cc:422
static number ngfMapP(number from, const coeffs src, const coeffs dst)
Definition: gnumpfl.cc:452
static number ngfMapQ(number from, const coeffs src, const coeffs dst)
Definition: gnumpfl.cc:414
static number ngfMapR(number from, const coeffs src, const coeffs dst)
Definition: gnumpfl.cc:443

◆ ngfSize()

static int ngfSize ( number  n,
const coeffs  r 
)
static

Definition at line 68 of file gnumpfl.cc.

69{
70 long i = ngfInt(n, r);
71 /* basically return the largest integer in n;
72 only if this happens to be zero although n != 0,
73 return 1;
74 (this code ensures that zero has the size zero) */
75 if ((i == 0) && (ngfIsZero(n,r) == FALSE)) i = 1;
76 return ABS(i);
77}
static int ABS(int v)
Definition: auxiliary.h:112

◆ ngfSub()

static number ngfSub ( number  a,
number  b,
const coeffs  R 
)
static

Definition at line 164 of file gnumpfl.cc.

165{
167
168 gmp_float* r= new gmp_float( (*(gmp_float*)a) - (*(gmp_float*)b) );
169 return (number)r;
170}

◆ ngfWrite()

static void ngfWrite ( number  a,
const coeffs  r 
)
static

Definition at line 371 of file gnumpfl.cc.

372{
374
375 char *out;
376 if ( a != NULL )
377 {
378 out= floatToStr(*(gmp_float*)a, r->float_len);
379 StringAppendS(out);
380 //omFreeSize((void *)out, (strlen(out)+1)* sizeof(char) );
381 omFree( (void *)out );
382 }
383 else
384 {
385 StringAppendS("0");
386 }
387}
char * floatToStr(const gmp_float &r, const unsigned int oprec)
Definition: mpr_complex.cc:578
#define omFree(addr)
Definition: omAllocDecl.h:261
void StringAppendS(const char *st)
Definition: reporter.cc:107