[GiNaC-list] Possible size issue in test in numeric.cpp

Pierangelo Masarati masarati at aero.polimi.it
Thu Aug 17 09:45:15 CEST 2006


Richard B. Kreckel writes: 

> This is documented in chapter 3.4 "Conversions".

Right, I stopped reading too early.  Anyway, what would be needed by GiNaC 
in this case, as far as I can tell, is only the test portion, without 
conversion.  For example, borrowing from CLN's notation: 

bool cl_int_needs_heap(const int x)
bool cl_uint_needs_heap(const unsigned int x); 

which basically checks whether a C int or unsigned will be stored by CLN 
without heap allocation.  This is based on the assumption that, at some 
point, the 2^29 limit may move to some other value (because you need more 
tags, for example). 

Yet another approach (possibly the safest) would be to remove the 2^29 
limitation in the cl_I::cl_I(const int) constructor, and let the constructor 
test for the value of the int. 

I feel I'm really drifting off-topic here; this discussion should really 
move to cln-list (if interesting at all). 

Cheers, p. 

Dr. Pierangelo Masarati               | voice: +39 02 2399 8309
Dip. Ing. Aerospaziale                | fax:   +39 02 2399 8334
Politecnico di Milano                 | mailto:pierangelo.masarati at polimi.it
via La Masa 34, 20156 Milano, Italy   | http://www.aero.polimi.it/~masarati 

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html 



More information about the GiNaC-list mailing list