Alternative bernoulli(const numeric &)

Markus Nullmeier markus.nullmeier at urz.uni-heidelberg.de
Tue Jan 22 23:58:36 CET 2002


> 
> I suspect the condition should really be `(p < (1UL<<cl_value_len/2))', in
> order to be portable across platforms...
> 

Well, I just followed the documentation which made me believe that
int -> cl_I conversion should work at least up to values of 2^29-1.
So maybe cl_value_len should be documented, as it indeed makes one
feel somewhat more secure. Now reading the headers it looks like a
weird (hypothetical?) system with alignment = 8 and sizeof(long) =
"32 bits" will break the documented behaviour :-/ Anyhow, I'm just
too lazy to incorporate this version of p^2/2 < 2^(cl_value_len-1)
into my sources and waiting for the next release...

Cheers, Markus



More information about the GiNaC-devel mailing list