]> www.ginac.de Git - cln.git/commitdiff
2006-04-25 Bruno Haible <bruno@clisp.org>
authorRichard Kreckel <kreckel@ginac.de>
Mon, 24 Apr 2006 22:55:26 +0000 (22:55 +0000)
committerRichard Kreckel <kreckel@ginac.de>
Mon, 24 Apr 2006 22:55:26 +0000 (22:55 +0000)
            Richard B. Kreckel  <kreckel@ginac.de>

Make it theoretically possible to use bignums and long-floats with
more than 2^32 significant digits or bits.
* doc/cln.tex (logcount): Change return type to uintC.
(struct cl_byte): Change elements to uintC.
(integer_length, ord2, power2p): Change return type to uintC.
(scale_float): Change argument type to sintC.
(float_digits, float_precision): Change return type to uintC.
* examples/atan_recip.cc: Use uintC instead of uintL where appropriate.
* examples/atanh_recip.cc: Likewise.
* include/cln/GV.h: Likewise.
* include/cln/GV_complex.h: Likewise.
* include/cln/GV_integer.h: Likewise.
* include/cln/GV_modinteger.h: Likewise.
* include/cln/GV_number.h: Likewise.
* include/cln/GV_rational.h: Likewise.
* include/cln/GV_real.h: Likewise.
* include/cln/SV.h: Likewise.
* include/cln/SV_complex.h: Likewise.
* include/cln/SV_integer.h: Likewise.
* include/cln/SV_number.h: Likewise.
* include/cln/SV_rational.h: Likewise.
* include/cln/SV_real.h: Likewise.
* include/cln/SV_ringelt.h: Likewise.
* include/cln/dfloat.h: Likewise.
* include/cln/ffloat.h: Likewise.
* include/cln/float.h: Likewise.
* include/cln/integer.h: Likewise.
* include/cln/lfloat.h: Likewise.
* include/cln/modinteger.h: Likewise.
* include/cln/sfloat.h: Likewise.
* src/base/cl_low.h (integerlengthC): New macro.
* src/base/digitseq/cl_2DS_div.cc: Use uintC instead of uintL where
appropriate.
* src/base/digitseq/cl_2DS_recip.cc: Likewise.
* src/base/digitseq/cl_DS.h: Likewise.
* src/base/digitseq/cl_DS_mul.c: Likewise.
* src/base/digitseq/cl_DS_mul_fftc.h: Likewise.
* src/base/digitseq/cl_DS_mul_fftcs.h: Likewise.
* src/base/digitseq/cl_DS_mul_fftm.h: Likewise.
* src/base/digitseq/cl_DS_mul_fftp.h: Likewise.
* src/base/digitseq/cl_DS_mul_fftp3.h: Likewise.
* src/base/digitseq/cl_DS_mul_fftp3m.h: Likewise.
* src/base/digitseq/cl_DS_mul_fftr.h: Likewise.
* src/base/digitseq/cl_DS_mul_kara.h: Likewise.
* src/base/digitseq/cl_DS_mul_nuss.h: Likewise.
* src/base/digitseq/cl_DS_recip.cc: Likewise.
* src/base/digitseq/cl_DS_recipsqrt.cc: Likewise.
* src/base/digitseq/cl_DS_sqrt.cc: Likewise.
* src/base/digitseq/cl_DS_trandom.cc: Likewise.
* src/complex/input/cl_N_read.cc: Likewise.
* src/complex/transcendental/cl_C_asinh_aux.cc: Likewise.
* src/complex/transcendental/cl_C_expt_C.cc: Likewise.
* src/float/cl_F.h: Likewise.
* src/float/conv/cl_F_from_F_f.cc: Likewise.
* src/float/conv/cl_F_from_I_f.cc: Likewise.
* src/float/conv/cl_F_from_RA_f.cc: Likewise.
* src/float/dfloat/conv/cl_I_to_double.cc: Likewise.
* src/float/dfloat/conv/cl_RA_to_double.cc: Likewise.
* src/float/dfloat/elem/cl_DF_from_I.cc: Likewise.
* src/float/dfloat/elem/cl_DF_from_RA.cc: Likewise.
* src/float/dfloat/elem/cl_DF_scale.cc: Likewise.
* src/float/dfloat/misc/cl_DF_digits.cc: Likewise.
* src/float/dfloat/misc/cl_DF_precision.cc: Likewise.
* src/float/elem/cl_F_scale.cc: Likewise.
* src/float/ffloat/conv/cl_I_to_float.cc: Likewise.
* src/float/ffloat/conv/cl_RA_to_float.cc: Likewise.
* src/float/ffloat/elem/cl_FF_from_I.cc: Likewise.
* src/float/ffloat/elem/cl_FF_from_RA.cc: Likewise.
* src/float/ffloat/elem/cl_FF_scale.cc: Likewise.
* src/float/ffloat/misc/cl_FF_digits.cc: Likewise.
* src/float/ffloat/misc/cl_FF_precision.cc: Likewise.
* src/float/input/cl_F_read.cc: Likewise.
* src/float/lfloat/algebraic/cl_LF_sqrt.cc: Likewise.
* src/float/lfloat/elem/cl_LF_1plus.cc: Likewise.
* src/float/lfloat/elem/cl_LF_I_div.cc: Likewise.
* src/float/lfloat/elem/cl_LF_I_mul.cc: Likewise.
* src/float/lfloat/elem/cl_LF_div.cc: Likewise.
* src/float/lfloat/elem/cl_LF_from_I.cc: Likewise.
* src/float/lfloat/elem/cl_LF_from_RA.cc: Likewise.
* src/float/lfloat/elem/cl_LF_fround.cc: Likewise.
* src/float/lfloat/elem/cl_LF_ftrunc.cc: Likewise.
* src/float/lfloat/elem/cl_LF_futrunc.cc: Likewise.
* src/float/lfloat/elem/cl_LF_scale.cc: Likewise.
* src/float/lfloat/elem/cl_LF_to_I.cc: Likewise.
* src/float/lfloat/misc/cl_LF_digits.cc: Likewise.
* src/float/lfloat/misc/cl_LF_idecode.cc: Likewise.
* src/float/lfloat/misc/cl_LF_leninc.cc: Likewise.
* src/float/lfloat/misc/cl_LF_lenincx.cc: Likewise.
* src/float/lfloat/misc/cl_LF_precision.cc: Likewise.
* src/float/lfloat/misc/cl_LF_shortenrel.cc: Likewise.
* src/float/lfloat/misc/cl_LF_shortenwith.cc: Likewise.
* src/float/misc/cl_F_digits.cc: Likewise.
* src/float/misc/cl_F_epsneg.cc: Likewise.
* src/float/misc/cl_F_epspos.cc: Likewise.
* src/float/misc/cl_F_leastneg.cc: Likewise.
* src/float/misc/cl_F_leastpos.cc: Likewise.
* src/float/misc/cl_F_mostneg.cc: Likewise.
* src/float/misc/cl_F_mostpos.cc: Likewise.
* src/float/misc/cl_F_precision.cc: Likewise.
* src/float/misc/cl_F_rational.cc: Likewise.
* src/float/misc/cl_F_shortenrel.cc: Likewise.
* src/float/output/cl_F_dprint.cc: Likewise.
* src/float/random/cl_F_random.cc: Likewise.
* src/float/sfloat/elem/cl_SF_from_I.cc: Likewise.
* src/float/sfloat/elem/cl_SF_from_RA.cc: Likewise.
* src/float/sfloat/elem/cl_SF_scale.cc: Likewise.
* src/float/sfloat/misc/cl_SF_digits.cc: Likewise.
* src/float/sfloat/misc/cl_SF_precision.cc: Likewise.
* src/float/transcendental/cl_F_atanhx.cc: Likewise.
* src/float/transcendental/cl_F_atanx.cc: Likewise.
* src/float/transcendental/cl_F_catalanconst_f.cc: Likewise.
* src/float/transcendental/cl_F_cos.cc: Likewise.
* src/float/transcendental/cl_F_cosh.cc: Likewise.
* src/float/transcendental/cl_F_coshsinh.cc: Likewise.
* src/float/transcendental/cl_F_cossin.cc: Likewise.
* src/float/transcendental/cl_F_eulerconst_f.cc: Likewise.
* src/float/transcendental/cl_F_exp1_f.cc: Likewise.
* src/float/transcendental/cl_F_expx.cc: Likewise.
* src/float/transcendental/cl_F_ln10_f.cc: Likewise.
* src/float/transcendental/cl_F_ln2_f.cc: Likewise.
* src/float/transcendental/cl_F_lnx.cc: Likewise.
* src/float/transcendental/cl_F_pi_f.cc: Likewise.
* src/float/transcendental/cl_F_sin.cc: Likewise.
* src/float/transcendental/cl_F_sinh.cc: Likewise.
* src/float/transcendental/cl_F_sinhx.cc: Likewise.
* src/float/transcendental/cl_F_sinx.cc: Likewise.
* src/float/transcendental/cl_F_tran.h: Likewise.
* src/float/transcendental/cl_F_zeta_int_f.cc: Likewise.
* src/float/transcendental/cl_LF_atan_recip.cc: Likewise.
* src/float/transcendental/cl_LF_atanh_recip.cc: Likewise.
* src/float/transcendental/cl_LF_catalanconst.cc: Likewise.
* src/float/transcendental/cl_LF_coshsinh_aux.cc: Likewise.
* src/float/transcendental/cl_LF_cossin_aux.cc: Likewise.
* src/float/transcendental/cl_LF_eulerconst.cc: Likewise.
* src/float/transcendental/cl_LF_exp1.cc: Likewise.
* src/float/transcendental/cl_LF_exp_aux.cc: Likewise.
* src/float/transcendental/cl_LF_pi.cc: Likewise.
* src/float/transcendental/cl_LF_ratseries.cc: Likewise.
* src/float/transcendental/cl_LF_ratseries_.cc: Likewise.
* src/float/transcendental/cl_LF_ratseries_a.cc: Likewise.
* src/float/transcendental/cl_LF_ratseries_ab.cc: Likewise.
* src/float/transcendental/cl_LF_ratseries_b.cc: Likewise.
* src/float/transcendental/cl_LF_ratseries_p.cc: Likewise.
* src/float/transcendental/cl_LF_ratseries_pa.cc: Likewise.
* src/float/transcendental/cl_LF_ratseries_pab.cc: Likewise.
* src/float/transcendental/cl_LF_ratseries_pb.cc: Likewise.
* src/float/transcendental/cl_LF_ratseries_pq.cc: Likewise.
* src/float/transcendental/cl_LF_ratseries_pqa.cc: Likewise.
* src/float/transcendental/cl_LF_ratseries_pqab.cc: Likewise.
* src/float/transcendental/cl_LF_ratseries_pqb.cc: Likewise.
* src/float/transcendental/cl_LF_ratseries_q.cc: Likewise.
* src/float/transcendental/cl_LF_ratseries_qa.cc: Likewise.
* src/float/transcendental/cl_LF_ratseries_qab.cc: Likewise.
* src/float/transcendental/cl_LF_ratseries_qb.cc: Likewise.
* src/float/transcendental/cl_LF_ratseries_stream_pq.cc: Likewise.
* src/float/transcendental/cl_LF_ratseries_stream_pqa.cc: Likewise.
* src/float/transcendental/cl_LF_ratseries_stream_pqab.cc: Likewise.
* src/float/transcendental/cl_LF_ratseries_stream_pqb.cc: Likewise.
* src/float/transcendental/cl_LF_ratsumseries_pqcd.cc: Likewise.
* src/float/transcendental/cl_LF_ratsumseries_pqcd_aux.cc: Likewise.
* src/float/transcendental/cl_LF_ratsumseries_pqd.cc: Likewise.
* src/float/transcendental/cl_LF_ratsumseries_pqd_aux.cc: Likewise.
* src/float/transcendental/cl_LF_tran.h: Likewise.
* src/float/transcendental/cl_LF_zeta3.cc: Likewise.
* src/float/transcendental/cl_LF_zeta_int.cc: Likewise.
* src/integer/algebraic/cl_I_rootp_I.cc: Likewise.
* src/integer/algebraic/cl_I_rootp_aux.cc: Likewise.
* src/integer/bitwise/cl_I_ash.cc: Likewise.
* src/integer/bitwise/cl_I_ash_I.cc: Likewise.
* src/integer/bitwise/cl_I_byte.h: Likewise.
* src/integer/bitwise/cl_I_fullbyte.cc: Likewise.
* src/integer/bitwise/cl_I_ilength.cc: Likewise.
* src/integer/bitwise/cl_I_ldb.cc: Likewise.
* src/integer/bitwise/cl_I_ldbtest.cc: Likewise.
* src/integer/bitwise/cl_I_ldbx.cc: Likewise.
* src/integer/bitwise/cl_I_ldbxtest.cc: Likewise.
* src/integer/bitwise/cl_I_logbitp.cc: Likewise.
* src/integer/bitwise/cl_I_logbitp_I.cc: Likewise.
* src/integer/bitwise/cl_I_logcount.cc: Likewise.
* src/integer/bitwise/cl_I_mkf.cc: Likewise.
* src/integer/bitwise/cl_I_mkfx.cc: Likewise.
* src/integer/cl_I.h: Likewise.
* src/integer/conv/cl_I_to_digits.cc: Likewise.
* src/integer/conv/cl_I_digits_need.cc: Likewise.
* src/integer/conv/cl_I_from_digits.cc: Likewise.
* src/integer/gcd/cl_I_gcd.cc: Likewise.
* src/integer/gcd/cl_I_xgcd.cc: Likewise.
* src/integer/misc/cl_I_eqhashcode.cc: Likewise.
* src/integer/misc/cl_I_ord2.cc: Likewise.
* src/integer/misc/cl_I_power2p.cc: Likewise.
* src/integer/output/cl_I_cached_power.h (cached_power_table): allow
for 40 elements.
* src/integer/output/cl_I_decstring.cc: Use uintC instead of uintL
where appropriate.
* src/integer/output/cl_I_print.cc: Likewise.
* src/integer/output/cl_I_print_string.cc: Likewise.
* src/modinteger/cl_MI.cc: Likewise.
* src/modinteger/cl_MI_lshift.cc: Likewise.
* src/modinteger/cl_MI_montgom.h: Likewise.
* src/modinteger/cl_MI_pow2.h: Likewise.
* src/modinteger/cl_MI_pow2m1.h: Likewise.
* src/modinteger/cl_MI_pow2p1.h: Likewise.
* src/modinteger/cl_MI_rshift.cc: Likewise.
* src/modinteger/cl_MI_std.h: Likewise.
* src/numtheory/cl_IF_millerrabin.cc: Likewise.
* src/numtheory/cl_nt_isprobprime.cc: Likewise.
* src/numtheory/cl_nt_sqrtmodp.cc: Likewise.
* src/polynomial/elem/cl_UP_GF2.h: Likewise.
* src/real/conv/cl_F_from_R_f.cc: Likewise.
* src/real/format-output/cl_fmt_floatstring.cc: Likewise.
* src/real/input/cl_R_read.cc: Likewise.
* src/vector/cl_GV_I.cc: Likewise.
* src/vector/cl_GV_I_copy.cc: Likewise.
* src/vector/cl_GV_number.cc: Likewise.
* src/vector/cl_GV_number_copy.cc: Likewise.
* src/vector/cl_SV_copy.cc: Likewise.
* src/vector/cl_SV_number.cc: Likewise.
* src/vector/cl_SV_ringelt.cc: Likewise.
* tests/main.cc: Likewise.
* tests/test_I_ilength.cc: Likewise.
* tests/test_I_ord2.cc: Likewise.

214 files changed:
ChangeLog
doc/cln.tex
examples/atan_recip.cc
examples/atanh_recip.cc
include/cln/GV.h
include/cln/GV_complex.h
include/cln/GV_integer.h
include/cln/GV_modinteger.h
include/cln/GV_number.h
include/cln/GV_rational.h
include/cln/GV_real.h
include/cln/SV.h
include/cln/SV_complex.h
include/cln/SV_integer.h
include/cln/SV_number.h
include/cln/SV_rational.h
include/cln/SV_real.h
include/cln/SV_ringelt.h
include/cln/dfloat.h
include/cln/ffloat.h
include/cln/float.h
include/cln/integer.h
include/cln/lfloat.h
include/cln/modinteger.h
include/cln/sfloat.h
include/cln/types.h
src/base/cl_low.h
src/base/digitseq/cl_2DS_div.cc
src/base/digitseq/cl_2DS_recip.cc
src/base/digitseq/cl_DS.h
src/base/digitseq/cl_DS_mul.cc
src/base/digitseq/cl_DS_mul_fftc.h
src/base/digitseq/cl_DS_mul_fftcs.h
src/base/digitseq/cl_DS_mul_fftm.h
src/base/digitseq/cl_DS_mul_fftp.h
src/base/digitseq/cl_DS_mul_fftp3.h
src/base/digitseq/cl_DS_mul_fftp3m.h
src/base/digitseq/cl_DS_mul_fftr.h
src/base/digitseq/cl_DS_mul_kara.h
src/base/digitseq/cl_DS_mul_nuss.h
src/base/digitseq/cl_DS_recip.cc
src/base/digitseq/cl_DS_recipsqrt.cc
src/base/digitseq/cl_DS_sqrt.cc
src/base/digitseq/cl_DS_trandom.cc
src/complex/input/cl_N_read.cc
src/complex/transcendental/cl_C_asinh_aux.cc
src/complex/transcendental/cl_C_expt_C.cc
src/float/cl_F.h
src/float/conv/cl_F_from_F_f.cc
src/float/conv/cl_F_from_I_f.cc
src/float/conv/cl_F_from_RA_f.cc
src/float/dfloat/conv/cl_I_to_double.cc
src/float/dfloat/conv/cl_RA_to_double.cc
src/float/dfloat/elem/cl_DF_from_I.cc
src/float/dfloat/elem/cl_DF_from_RA.cc
src/float/dfloat/elem/cl_DF_scale.cc
src/float/dfloat/misc/cl_DF_digits.cc
src/float/dfloat/misc/cl_DF_precision.cc
src/float/elem/cl_F_scale.cc
src/float/ffloat/conv/cl_I_to_float.cc
src/float/ffloat/conv/cl_RA_to_float.cc
src/float/ffloat/elem/cl_FF_from_I.cc
src/float/ffloat/elem/cl_FF_from_RA.cc
src/float/ffloat/elem/cl_FF_scale.cc
src/float/ffloat/misc/cl_FF_digits.cc
src/float/ffloat/misc/cl_FF_precision.cc
src/float/input/cl_F_read.cc
src/float/lfloat/algebraic/cl_LF_sqrt.cc
src/float/lfloat/elem/cl_LF_1plus.cc
src/float/lfloat/elem/cl_LF_I_div.cc
src/float/lfloat/elem/cl_LF_I_mul.cc
src/float/lfloat/elem/cl_LF_div.cc
src/float/lfloat/elem/cl_LF_from_I.cc
src/float/lfloat/elem/cl_LF_from_RA.cc
src/float/lfloat/elem/cl_LF_fround.cc
src/float/lfloat/elem/cl_LF_ftrunc.cc
src/float/lfloat/elem/cl_LF_futrunc.cc
src/float/lfloat/elem/cl_LF_scale.cc
src/float/lfloat/elem/cl_LF_to_I.cc
src/float/lfloat/misc/cl_LF_digits.cc
src/float/lfloat/misc/cl_LF_idecode.cc
src/float/lfloat/misc/cl_LF_leninc.cc
src/float/lfloat/misc/cl_LF_lenincx.cc
src/float/lfloat/misc/cl_LF_precision.cc
src/float/lfloat/misc/cl_LF_shortenrel.cc
src/float/lfloat/misc/cl_LF_shortenwith.cc
src/float/misc/cl_F_digits.cc
src/float/misc/cl_F_epsneg.cc
src/float/misc/cl_F_epspos.cc
src/float/misc/cl_F_leastneg.cc
src/float/misc/cl_F_leastpos.cc
src/float/misc/cl_F_mostneg.cc
src/float/misc/cl_F_mostpos.cc
src/float/misc/cl_F_precision.cc
src/float/misc/cl_F_rational.cc
src/float/misc/cl_F_shortenrel.cc
src/float/output/cl_F_dprint.cc
src/float/random/cl_F_random.cc
src/float/sfloat/elem/cl_SF_from_I.cc
src/float/sfloat/elem/cl_SF_from_RA.cc
src/float/sfloat/elem/cl_SF_scale.cc
src/float/sfloat/misc/cl_SF_digits.cc
src/float/sfloat/misc/cl_SF_precision.cc
src/float/transcendental/cl_F_atanhx.cc
src/float/transcendental/cl_F_atanx.cc
src/float/transcendental/cl_F_catalanconst_f.cc
src/float/transcendental/cl_F_cos.cc
src/float/transcendental/cl_F_cosh.cc
src/float/transcendental/cl_F_coshsinh.cc
src/float/transcendental/cl_F_cossin.cc
src/float/transcendental/cl_F_eulerconst_f.cc
src/float/transcendental/cl_F_exp1_f.cc
src/float/transcendental/cl_F_expx.cc
src/float/transcendental/cl_F_ln10_f.cc
src/float/transcendental/cl_F_ln2_f.cc
src/float/transcendental/cl_F_lnx.cc
src/float/transcendental/cl_F_pi_f.cc
src/float/transcendental/cl_F_sin.cc
src/float/transcendental/cl_F_sinh.cc
src/float/transcendental/cl_F_sinhx.cc
src/float/transcendental/cl_F_sinx.cc
src/float/transcendental/cl_F_tran.h
src/float/transcendental/cl_F_zeta_int_f.cc
src/float/transcendental/cl_LF_atan_recip.cc
src/float/transcendental/cl_LF_atanh_recip.cc
src/float/transcendental/cl_LF_catalanconst.cc
src/float/transcendental/cl_LF_coshsinh_aux.cc
src/float/transcendental/cl_LF_cossin_aux.cc
src/float/transcendental/cl_LF_eulerconst.cc
src/float/transcendental/cl_LF_exp1.cc
src/float/transcendental/cl_LF_exp_aux.cc
src/float/transcendental/cl_LF_pi.cc
src/float/transcendental/cl_LF_ratseries.cc
src/float/transcendental/cl_LF_ratseries_.cc
src/float/transcendental/cl_LF_ratseries_a.cc
src/float/transcendental/cl_LF_ratseries_ab.cc
src/float/transcendental/cl_LF_ratseries_b.cc
src/float/transcendental/cl_LF_ratseries_p.cc
src/float/transcendental/cl_LF_ratseries_pa.cc
src/float/transcendental/cl_LF_ratseries_pab.cc
src/float/transcendental/cl_LF_ratseries_pb.cc
src/float/transcendental/cl_LF_ratseries_pq.cc
src/float/transcendental/cl_LF_ratseries_pqa.cc
src/float/transcendental/cl_LF_ratseries_pqab.cc
src/float/transcendental/cl_LF_ratseries_pqb.cc
src/float/transcendental/cl_LF_ratseries_q.cc
src/float/transcendental/cl_LF_ratseries_qa.cc
src/float/transcendental/cl_LF_ratseries_qab.cc
src/float/transcendental/cl_LF_ratseries_qb.cc
src/float/transcendental/cl_LF_ratseries_stream_pq.cc
src/float/transcendental/cl_LF_ratseries_stream_pqa.cc
src/float/transcendental/cl_LF_ratseries_stream_pqab.cc
src/float/transcendental/cl_LF_ratseries_stream_pqb.cc
src/float/transcendental/cl_LF_ratsumseries_pqcd.cc
src/float/transcendental/cl_LF_ratsumseries_pqcd_aux.cc
src/float/transcendental/cl_LF_ratsumseries_pqd.cc
src/float/transcendental/cl_LF_ratsumseries_pqd_aux.cc
src/float/transcendental/cl_LF_tran.h
src/float/transcendental/cl_LF_zeta3.cc
src/float/transcendental/cl_LF_zeta_int.cc
src/integer/algebraic/cl_I_rootp_I.cc
src/integer/algebraic/cl_I_rootp_aux.cc
src/integer/bitwise/cl_I_ash.cc
src/integer/bitwise/cl_I_ash_I.cc
src/integer/bitwise/cl_I_byte.h
src/integer/bitwise/cl_I_fullbyte.cc
src/integer/bitwise/cl_I_ilength.cc
src/integer/bitwise/cl_I_ldb.cc
src/integer/bitwise/cl_I_ldbtest.cc
src/integer/bitwise/cl_I_ldbx.cc
src/integer/bitwise/cl_I_ldbxtest.cc
src/integer/bitwise/cl_I_logbitp.cc
src/integer/bitwise/cl_I_logbitp_I.cc
src/integer/bitwise/cl_I_logcount.cc
src/integer/bitwise/cl_I_mkf.cc
src/integer/bitwise/cl_I_mkfx.cc
src/integer/cl_I.h
src/integer/conv/cl_I_cached_power.h
src/integer/conv/cl_I_digits_need.cc
src/integer/conv/cl_I_from_digits.cc
src/integer/conv/cl_I_to_digits.cc
src/integer/gcd/cl_I_gcd.cc
src/integer/gcd/cl_I_xgcd.cc
src/integer/misc/cl_I_eqhashcode.cc
src/integer/misc/cl_I_ord2.cc
src/integer/misc/cl_I_power2p.cc
src/integer/output/cl_I_decstring.cc
src/integer/output/cl_I_print.cc
src/integer/output/cl_I_print_string.cc
src/modinteger/cl_MI.cc
src/modinteger/cl_MI_lshift.cc
src/modinteger/cl_MI_montgom.h
src/modinteger/cl_MI_pow2.h
src/modinteger/cl_MI_pow2m1.h
src/modinteger/cl_MI_pow2p1.h
src/modinteger/cl_MI_rshift.cc
src/modinteger/cl_MI_std.h
src/numtheory/cl_IF_millerrabin.cc
src/numtheory/cl_nt_isprobprime.cc
src/numtheory/cl_nt_sqrtmodp.cc
src/polynomial/elem/cl_UP_GF2.h
src/real/conv/cl_F_from_R_f.cc
src/real/format-output/cl_fmt_floatstring.cc
src/real/input/cl_R_read.cc
src/vector/cl_GV_I.cc
src/vector/cl_GV_I_copy.cc
src/vector/cl_GV_number.cc
src/vector/cl_GV_number_copy.cc
src/vector/cl_SV_copy.cc
src/vector/cl_SV_number.cc
src/vector/cl_SV_ringelt.cc
tests/main.cc
tests/test_I_ilength.cc
tests/test_I_ord2.cc

index 7b06fab1f9de136c83bcfeeb5649747f525fa8b2..de6c0e051ad587a87b32ebd503c1ac9e9a6e0f4a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,228 @@
+2006-04-25  Bruno Haible  <bruno@clisp.org>
+            Richard B. Kreckel  <kreckel@ginac.de>
+
+       Make it theoretically possible to use bignums and long-floats with
+       more than 2^32 significant digits or bits.
+       * doc/cln.tex (logcount): Change return type to uintC.
+       (struct cl_byte): Change elements to uintC.
+       (integer_length, ord2, power2p): Change return type to uintC.
+       (scale_float): Change argument type to sintC.
+       (float_digits, float_precision): Change return type to uintC.
+       * examples/atan_recip.cc: Use uintC instead of uintL where appropriate.
+       * examples/atanh_recip.cc: Likewise.
+       * include/cln/GV.h: Likewise.
+       * include/cln/GV_complex.h: Likewise.
+       * include/cln/GV_integer.h: Likewise.
+       * include/cln/GV_modinteger.h: Likewise.
+       * include/cln/GV_number.h: Likewise.
+       * include/cln/GV_rational.h: Likewise.
+       * include/cln/GV_real.h: Likewise.
+       * include/cln/SV.h: Likewise.
+       * include/cln/SV_complex.h: Likewise.
+       * include/cln/SV_integer.h: Likewise.
+       * include/cln/SV_number.h: Likewise.
+       * include/cln/SV_rational.h: Likewise.
+       * include/cln/SV_real.h: Likewise.
+       * include/cln/SV_ringelt.h: Likewise.
+       * include/cln/dfloat.h: Likewise.
+       * include/cln/ffloat.h: Likewise.
+       * include/cln/float.h: Likewise.
+       * include/cln/integer.h: Likewise.
+       * include/cln/lfloat.h: Likewise.
+       * include/cln/modinteger.h: Likewise.
+       * include/cln/sfloat.h: Likewise.
+       * src/base/cl_low.h (integerlengthC): New macro.
+       * src/base/digitseq/cl_2DS_div.cc: Use uintC instead of uintL where
+       appropriate.
+       * src/base/digitseq/cl_2DS_recip.cc: Likewise.
+       * src/base/digitseq/cl_DS.h: Likewise.
+       * src/base/digitseq/cl_DS_mul.c: Likewise.
+       * src/base/digitseq/cl_DS_mul_fftc.h: Likewise.
+       * src/base/digitseq/cl_DS_mul_fftcs.h: Likewise.
+       * src/base/digitseq/cl_DS_mul_fftm.h: Likewise.
+       * src/base/digitseq/cl_DS_mul_fftp.h: Likewise.
+       * src/base/digitseq/cl_DS_mul_fftp3.h: Likewise.
+       * src/base/digitseq/cl_DS_mul_fftp3m.h: Likewise.
+       * src/base/digitseq/cl_DS_mul_fftr.h: Likewise.
+       * src/base/digitseq/cl_DS_mul_kara.h: Likewise.
+       * src/base/digitseq/cl_DS_mul_nuss.h: Likewise.
+       * src/base/digitseq/cl_DS_recip.cc: Likewise.
+       * src/base/digitseq/cl_DS_recipsqrt.cc: Likewise.
+       * src/base/digitseq/cl_DS_sqrt.cc: Likewise.
+       * src/base/digitseq/cl_DS_trandom.cc: Likewise.
+       * src/complex/input/cl_N_read.cc: Likewise.
+       * src/complex/transcendental/cl_C_asinh_aux.cc: Likewise.
+       * src/complex/transcendental/cl_C_expt_C.cc: Likewise.
+       * src/float/cl_F.h: Likewise.
+       * src/float/conv/cl_F_from_F_f.cc: Likewise.
+       * src/float/conv/cl_F_from_I_f.cc: Likewise.
+       * src/float/conv/cl_F_from_RA_f.cc: Likewise.
+       * src/float/dfloat/conv/cl_I_to_double.cc: Likewise.
+       * src/float/dfloat/conv/cl_RA_to_double.cc: Likewise.
+       * src/float/dfloat/elem/cl_DF_from_I.cc: Likewise.
+       * src/float/dfloat/elem/cl_DF_from_RA.cc: Likewise.
+       * src/float/dfloat/elem/cl_DF_scale.cc: Likewise.
+       * src/float/dfloat/misc/cl_DF_digits.cc: Likewise.
+       * src/float/dfloat/misc/cl_DF_precision.cc: Likewise.
+       * src/float/elem/cl_F_scale.cc: Likewise.
+       * src/float/ffloat/conv/cl_I_to_float.cc: Likewise.
+       * src/float/ffloat/conv/cl_RA_to_float.cc: Likewise.
+       * src/float/ffloat/elem/cl_FF_from_I.cc: Likewise.
+       * src/float/ffloat/elem/cl_FF_from_RA.cc: Likewise.
+       * src/float/ffloat/elem/cl_FF_scale.cc: Likewise.
+       * src/float/ffloat/misc/cl_FF_digits.cc: Likewise.
+       * src/float/ffloat/misc/cl_FF_precision.cc: Likewise.
+       * src/float/input/cl_F_read.cc: Likewise.
+       * src/float/lfloat/algebraic/cl_LF_sqrt.cc: Likewise.
+       * src/float/lfloat/elem/cl_LF_1plus.cc: Likewise.
+       * src/float/lfloat/elem/cl_LF_I_div.cc: Likewise.
+       * src/float/lfloat/elem/cl_LF_I_mul.cc: Likewise.
+       * src/float/lfloat/elem/cl_LF_div.cc: Likewise.
+       * src/float/lfloat/elem/cl_LF_from_I.cc: Likewise.
+       * src/float/lfloat/elem/cl_LF_from_RA.cc: Likewise.
+       * src/float/lfloat/elem/cl_LF_fround.cc: Likewise.
+       * src/float/lfloat/elem/cl_LF_ftrunc.cc: Likewise.
+       * src/float/lfloat/elem/cl_LF_futrunc.cc: Likewise.
+       * src/float/lfloat/elem/cl_LF_scale.cc: Likewise.
+       * src/float/lfloat/elem/cl_LF_to_I.cc: Likewise.
+       * src/float/lfloat/misc/cl_LF_digits.cc: Likewise.
+       * src/float/lfloat/misc/cl_LF_idecode.cc: Likewise.
+       * src/float/lfloat/misc/cl_LF_leninc.cc: Likewise.
+       * src/float/lfloat/misc/cl_LF_lenincx.cc: Likewise.
+       * src/float/lfloat/misc/cl_LF_precision.cc: Likewise.
+       * src/float/lfloat/misc/cl_LF_shortenrel.cc: Likewise.
+       * src/float/lfloat/misc/cl_LF_shortenwith.cc: Likewise.
+       * src/float/misc/cl_F_digits.cc: Likewise.
+       * src/float/misc/cl_F_epsneg.cc: Likewise.
+       * src/float/misc/cl_F_epspos.cc: Likewise.
+       * src/float/misc/cl_F_leastneg.cc: Likewise.
+       * src/float/misc/cl_F_leastpos.cc: Likewise.
+       * src/float/misc/cl_F_mostneg.cc: Likewise.
+       * src/float/misc/cl_F_mostpos.cc: Likewise.
+       * src/float/misc/cl_F_precision.cc: Likewise.
+       * src/float/misc/cl_F_rational.cc: Likewise.
+       * src/float/misc/cl_F_shortenrel.cc: Likewise.
+       * src/float/output/cl_F_dprint.cc: Likewise.
+       * src/float/random/cl_F_random.cc: Likewise.
+       * src/float/sfloat/elem/cl_SF_from_I.cc: Likewise.
+       * src/float/sfloat/elem/cl_SF_from_RA.cc: Likewise.
+       * src/float/sfloat/elem/cl_SF_scale.cc: Likewise.
+       * src/float/sfloat/misc/cl_SF_digits.cc: Likewise.
+       * src/float/sfloat/misc/cl_SF_precision.cc: Likewise.
+       * src/float/transcendental/cl_F_atanhx.cc: Likewise.
+       * src/float/transcendental/cl_F_atanx.cc: Likewise.
+       * src/float/transcendental/cl_F_catalanconst_f.cc: Likewise.
+       * src/float/transcendental/cl_F_cos.cc: Likewise.
+       * src/float/transcendental/cl_F_cosh.cc: Likewise.
+       * src/float/transcendental/cl_F_coshsinh.cc: Likewise.
+       * src/float/transcendental/cl_F_cossin.cc: Likewise.
+       * src/float/transcendental/cl_F_eulerconst_f.cc: Likewise.
+       * src/float/transcendental/cl_F_exp1_f.cc: Likewise.
+       * src/float/transcendental/cl_F_expx.cc: Likewise.
+       * src/float/transcendental/cl_F_ln10_f.cc: Likewise.
+       * src/float/transcendental/cl_F_ln2_f.cc: Likewise.
+       * src/float/transcendental/cl_F_lnx.cc: Likewise.
+       * src/float/transcendental/cl_F_pi_f.cc: Likewise.
+       * src/float/transcendental/cl_F_sin.cc: Likewise.
+       * src/float/transcendental/cl_F_sinh.cc: Likewise.
+       * src/float/transcendental/cl_F_sinhx.cc: Likewise.
+       * src/float/transcendental/cl_F_sinx.cc: Likewise.
+       * src/float/transcendental/cl_F_tran.h: Likewise.
+       * src/float/transcendental/cl_F_zeta_int_f.cc: Likewise.
+       * src/float/transcendental/cl_LF_atan_recip.cc: Likewise.
+       * src/float/transcendental/cl_LF_atanh_recip.cc: Likewise.
+       * src/float/transcendental/cl_LF_catalanconst.cc: Likewise.
+       * src/float/transcendental/cl_LF_coshsinh_aux.cc: Likewise.
+       * src/float/transcendental/cl_LF_cossin_aux.cc: Likewise.
+       * src/float/transcendental/cl_LF_eulerconst.cc: Likewise.
+       * src/float/transcendental/cl_LF_exp1.cc: Likewise.
+       * src/float/transcendental/cl_LF_exp_aux.cc: Likewise.
+       * src/float/transcendental/cl_LF_pi.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratseries.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratseries_.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratseries_a.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratseries_ab.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratseries_b.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratseries_p.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratseries_pa.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratseries_pab.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratseries_pb.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratseries_pq.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratseries_pqa.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratseries_pqab.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratseries_pqb.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratseries_q.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratseries_qa.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratseries_qab.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratseries_qb.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratseries_stream_pq.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratseries_stream_pqa.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratseries_stream_pqab.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratseries_stream_pqb.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratsumseries_pqcd.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratsumseries_pqcd_aux.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratsumseries_pqd.cc: Likewise.
+       * src/float/transcendental/cl_LF_ratsumseries_pqd_aux.cc: Likewise.
+       * src/float/transcendental/cl_LF_tran.h: Likewise.
+       * src/float/transcendental/cl_LF_zeta3.cc: Likewise.
+       * src/float/transcendental/cl_LF_zeta_int.cc: Likewise.
+       * src/integer/algebraic/cl_I_rootp_I.cc: Likewise.
+       * src/integer/algebraic/cl_I_rootp_aux.cc: Likewise.
+       * src/integer/bitwise/cl_I_ash.cc: Likewise.
+       * src/integer/bitwise/cl_I_ash_I.cc: Likewise.
+       * src/integer/bitwise/cl_I_byte.h: Likewise.
+       * src/integer/bitwise/cl_I_fullbyte.cc: Likewise.
+       * src/integer/bitwise/cl_I_ilength.cc: Likewise.
+       * src/integer/bitwise/cl_I_ldb.cc: Likewise.
+       * src/integer/bitwise/cl_I_ldbtest.cc: Likewise.
+       * src/integer/bitwise/cl_I_ldbx.cc: Likewise.
+       * src/integer/bitwise/cl_I_ldbxtest.cc: Likewise.
+       * src/integer/bitwise/cl_I_logbitp.cc: Likewise.
+       * src/integer/bitwise/cl_I_logbitp_I.cc: Likewise.
+       * src/integer/bitwise/cl_I_logcount.cc: Likewise.
+       * src/integer/bitwise/cl_I_mkf.cc: Likewise.
+       * src/integer/bitwise/cl_I_mkfx.cc: Likewise.
+       * src/integer/cl_I.h: Likewise.
+       * src/integer/conv/cl_I_to_digits.cc: Likewise.
+       * src/integer/conv/cl_I_digits_need.cc: Likewise.
+       * src/integer/conv/cl_I_from_digits.cc: Likewise.
+       * src/integer/gcd/cl_I_gcd.cc: Likewise.
+       * src/integer/gcd/cl_I_xgcd.cc: Likewise.
+       * src/integer/misc/cl_I_eqhashcode.cc: Likewise.
+       * src/integer/misc/cl_I_ord2.cc: Likewise.
+       * src/integer/misc/cl_I_power2p.cc: Likewise.
+       * src/integer/output/cl_I_cached_power.h (cached_power_table): allow
+       for 40 elements.
+       * src/integer/output/cl_I_decstring.cc: Use uintC instead of uintL
+       where appropriate.
+       * src/integer/output/cl_I_print.cc: Likewise.
+       * src/integer/output/cl_I_print_string.cc: Likewise.
+       * src/modinteger/cl_MI.cc: Likewise.
+       * src/modinteger/cl_MI_lshift.cc: Likewise.
+       * src/modinteger/cl_MI_montgom.h: Likewise.
+       * src/modinteger/cl_MI_pow2.h: Likewise.
+       * src/modinteger/cl_MI_pow2m1.h: Likewise.
+       * src/modinteger/cl_MI_pow2p1.h: Likewise.
+       * src/modinteger/cl_MI_rshift.cc: Likewise.
+       * src/modinteger/cl_MI_std.h: Likewise.
+       * src/numtheory/cl_IF_millerrabin.cc: Likewise.
+       * src/numtheory/cl_nt_isprobprime.cc: Likewise.
+       * src/numtheory/cl_nt_sqrtmodp.cc: Likewise.
+       * src/polynomial/elem/cl_UP_GF2.h: Likewise.
+       * src/real/conv/cl_F_from_R_f.cc: Likewise.
+       * src/real/format-output/cl_fmt_floatstring.cc: Likewise.
+       * src/real/input/cl_R_read.cc: Likewise.
+       * src/vector/cl_GV_I.cc: Likewise.
+       * src/vector/cl_GV_I_copy.cc: Likewise.
+       * src/vector/cl_GV_number.cc: Likewise.
+       * src/vector/cl_GV_number_copy.cc: Likewise.
+       * src/vector/cl_SV_copy.cc: Likewise.
+       * src/vector/cl_SV_number.cc: Likewise.
+       * src/vector/cl_SV_ringelt.cc: Likewise.
+       * tests/main.cc: Likewise.
+       * tests/test_I_ilength.cc: Likewise.
+       * tests/test_I_ord2.cc: Likewise.
+
 2006-04-19  Bruno Haible  <bruno@clisp.org>
 
        Prepare for autoconf-2.60.
index fd71f60c6090059c8c4ae00d0ee3f2d6d720dbbc..5e47dd0379199df4045362c07b7f422941fa1bf6 100644 (file)
@@ -1804,7 +1804,7 @@ Returns true if some bit is set in both @code{x} and @code{y}, i.e. if
 Returns true if the @code{n}th bit (from the right) of @code{x} is set.
 Bit 0 is the least significant bit.
 
-@item uintL logcount (const cl_I& x)
+@item uintC logcount (const cl_I& x)
 @cindex @code{logcount ()}
 Returns the number of one bits in @code{x}, if @code{x} >= 0, or
 the number of zero bits in @code{x}, if @code{x} < 0.
@@ -1813,7 +1813,7 @@ the number of zero bits in @code{x}, if @code{x} < 0.
 The following functions operate on intervals of bits in integers. 
 The type
 @example
-struct cl_byte @{ uintL size; uintL position; @};
+struct cl_byte @{ uintC size; uintC position; @};
 @end example
 @cindex @code{cl_byte}
 represents the bit interval containing the bits
@@ -1895,20 +1895,20 @@ Shifts @code{x} by @code{y} bits to the left (if @code{y}>=0) or
 by @code{-y} bits to the right (if @code{y}<=0). In other words, this
 returns @code{floor(x * expt(2,y))}.
 
-@item uintL integer_length (const cl_I& x)
+@item uintC integer_length (const cl_I& x)
 @cindex @code{integer_length ()}
 Returns the number of bits (excluding the sign bit) needed to represent @code{x}
 in two's complement notation. This is the smallest n >= 0 such that
 -2^n <= x < 2^n. If x > 0, this is the unique n > 0 such that
 2^(n-1) <= x < 2^n.
 
-@item uintL ord2 (const cl_I& x)
+@item uintC ord2 (const cl_I& x)
 @cindex @code{ord2 ()}
 @code{x} must be non-zero. This function returns the number of 0 bits at the
 right of @code{x} in two's complement notation. This is the largest n >= 0
 such that 2^n divides @code{x}.
 
-@item uintL power2p (const cl_I& x)
+@item uintC power2p (const cl_I& x)
 @cindex @code{power2p ()}
 @code{x} must be > 0. This function checks whether @code{x} is a power of 2.
 If @code{x} = 2^(n-1), it returns n. Else it returns 0.
@@ -2012,7 +2012,7 @@ Each of the classes
 defines the following operations.
 
 @table @code
-@item @var{type} scale_float (const @var{type}& x, sintL delta)
+@item @var{type} scale_float (const @var{type}& x, sintC delta)
 @cindex @code{scale_float ()}
 @itemx @var{type} scale_float (const @var{type}& x, const cl_I& delta)
 Returns @code{x*2^delta}. This is more efficient than an explicit multiplication
@@ -2038,13 +2038,13 @@ Returns the base of the floating-point representation. This is always @code{2}.
 Returns the sign @code{s} of @code{x} as a float. The value is 1 for
 @code{x} >= 0, -1 for @code{x} < 0.
 
-@item uintL float_digits (const @var{type}& x)
+@item uintC float_digits (const @var{type}& x)
 @cindex @code{float_digits ()}
 Returns the number of mantissa bits in the floating-point representation
 of @code{x}, including the hidden bit. The value only depends on the type
 of @code{x}, not on its value.
 
-@item uintL float_precision (const @var{type}& x)
+@item uintC float_precision (const @var{type}& x)
 @cindex @code{float_precision ()}
 Returns the number of significant mantissa bits in the floating-point
 representation of @code{x}. Since denormalized numbers are not supported,
index 1540bd5761fbe6aa9d6ce73705f60e9969c4e306..824814c640b21737d5c1fce329a105b1b3147df4 100644 (file)
@@ -31,11 +31,11 @@ using namespace cln;
 const cl_LF atan_recip_1a (cl_I m, uintC len)
 {
        var uintC actuallen = len + 1;
-       var cl_LF eps = scale_float(cl_I_to_LF(1,actuallen),-intDsize*(sintL)actuallen);
+       var cl_LF eps = scale_float(cl_I_to_LF(1,actuallen),-intDsize*(sintC)actuallen);
        var cl_I m2 = m*m;
        var cl_LF fterm = cl_I_to_LF(1,actuallen)/m;
        var cl_LF fsum = fterm;
-       for (var uintL n = 1; fterm >= eps; n++) {
+       for (var uintC n = 1; fterm >= eps; n++) {
                fterm = fterm/m2;
                fterm = cl_LF_shortenwith(fterm,eps);
                if ((n % 2) == 0)
@@ -52,23 +52,23 @@ const cl_LF atan_recip_1b (cl_I m, uintC len)
        var cl_I m2 = m*m;
        var cl_I fterm = floor1((cl_I)1 << (intDsize*actuallen), m);
        var cl_I fsum = fterm;
-       for (var uintL n = 1; fterm > 0; n++) {
+       for (var uintC n = 1; fterm > 0; n++) {
                fterm = floor1(fterm,m2);
                if ((n % 2) == 0)
                        fsum = fsum + floor1(fterm,2*n+1);
                else
                        fsum = fsum - floor1(fterm,2*n+1);
        }
-       return scale_float(cl_I_to_LF(fsum,len),-intDsize*(sintL)actuallen);
+       return scale_float(cl_I_to_LF(fsum,len),-intDsize*(sintC)actuallen);
 }
 
 const cl_LF atan_recip_1c (cl_I m, uintC len)
 {
        var uintC actuallen = len + 1;
        var cl_I m2 = m*m;
-       var sintL N = (sintL)(0.69314718*intDsize/2*actuallen/log(double_approx(m))) + 1;
+       var sintC N = (sintC)(0.69314718*intDsize/2*actuallen/log(double_approx(m))) + 1;
        var cl_I num = 0, den = 1; // "lazy rational number"
-       for (sintL n = N-1; n>=0; n--) {
+       for (sintC n = N-1; n>=0; n--) {
                // Multiply sum with 1/m^2:
                den = den * m2;
                // Add (-1)^n/(2n+1):
@@ -87,11 +87,11 @@ const cl_LF atan_recip_1d (cl_I m, uintC len)
 {
        var uintC actuallen = len + 1;
        var cl_I m2 = m*m;
-       var uintL N = (uintL)(0.69314718*intDsize/2*actuallen/log(double_approx(m))) + 1;
+       var uintC N = (uintC)(0.69314718*intDsize/2*actuallen/log(double_approx(m))) + 1;
        CL_ALLOCA_STACK;
        var cl_I* bv = (cl_I*) cl_alloca(N*sizeof(cl_I));
        var cl_I* qv = (cl_I*) cl_alloca(N*sizeof(cl_I));
-       var uintL n;
+       var uintC n;
        for (n = 0; n < N; n++) {
                new (&bv[n]) cl_I ((n % 2) == 0 ? (cl_I)(2*n+1) : -(cl_I)(2*n+1));
                new (&qv[n]) cl_I (n==0 ? m : m2);
@@ -113,11 +113,11 @@ const cl_LF atan_recip_1d (cl_I m, uintC len)
 const cl_LF atan_recip_2a (cl_I m, uintC len)
 {
        var uintC actuallen = len + 1;
-       var cl_LF eps = scale_float(cl_I_to_LF(1,actuallen),-intDsize*(sintL)actuallen);
+       var cl_LF eps = scale_float(cl_I_to_LF(1,actuallen),-intDsize*(sintC)actuallen);
        var cl_I m2 = m*m+1;
        var cl_LF fterm = cl_I_to_LF(m,actuallen)/m2;
        var cl_LF fsum = fterm;
-       for (var uintL n = 1; fterm >= eps; n++) {
+       for (var uintC n = 1; fterm >= eps; n++) {
                fterm = The(cl_LF)((2*n)*fterm)/((2*n+1)*m2);
                fterm = cl_LF_shortenwith(fterm,eps);
                fsum = fsum + LF_to_LF(fterm,actuallen);
@@ -131,20 +131,20 @@ const cl_LF atan_recip_2b (cl_I m, uintC len)
        var cl_I m2 = m*m+1;
        var cl_I fterm = floor1((cl_I)m << (intDsize*actuallen), m2);
        var cl_I fsum = fterm;
-       for (var uintL n = 1; fterm > 0; n++) {
+       for (var uintC n = 1; fterm > 0; n++) {
                fterm = floor1((2*n)*fterm,(2*n+1)*m2);
                fsum = fsum + fterm;
        }
-       return scale_float(cl_I_to_LF(fsum,len),-intDsize*(sintL)actuallen);
+       return scale_float(cl_I_to_LF(fsum,len),-intDsize*(sintC)actuallen);
 }
 
 const cl_LF atan_recip_2c (cl_I m, uintC len)
 {
        var uintC actuallen = len + 1;
        var cl_I m2 = m*m+1;
-       var uintL N = (uintL)(0.69314718*intDsize*actuallen/log(double_approx(m2))) + 1;
+       var uintC N = (uintC)(0.69314718*intDsize*actuallen/log(double_approx(m2))) + 1;
        var cl_I num = 0, den = 1; // "lazy rational number"
-       for (uintL n = N; n>0; n--) {
+       for (uintC n = N; n>0; n--) {
                // Multiply sum with (2n)/(2n+1)(m^2+1):
                num = num * (2*n);
                den = den * ((2*n+1)*m2);
@@ -161,11 +161,11 @@ const cl_LF atan_recip_2d (cl_I m, uintC len)
 {
        var uintC actuallen = len + 1;
        var cl_I m2 = m*m+1;
-       var uintL N = (uintL)(0.69314718*intDsize*actuallen/log(double_approx(m2))) + 1;
+       var uintC N = (uintC)(0.69314718*intDsize*actuallen/log(double_approx(m2))) + 1;
        CL_ALLOCA_STACK;
        var cl_I* pv = (cl_I*) cl_alloca(N*sizeof(cl_I));
        var cl_I* qv = (cl_I*) cl_alloca(N*sizeof(cl_I));
-       var uintL n;
+       var uintC n;
        new (&pv[0]) cl_I (m);
        new (&qv[0]) cl_I (m2);
        for (n = 1; n < N; n++) {
@@ -196,7 +196,7 @@ int main (int argc, char * argv[])
        if (argc < 2)
                exit(1);
        cl_I m = (cl_I)argv[1];
-       uintL len = atoi(argv[2]);
+       uintC len = atol(argv[2]);
        cl_LF p;
        ln(cl_I_to_LF(1000,len+10)); // fill cache
        // Method 1.
index 991cc3093462bcf0d8fd78480ac78f35c7ab97b3..51455bd3e800da198659359fd1c1c8c4e4e22ca7 100644 (file)
 const cl_LF atanh_recip_1a (cl_I m, uintC len)
 {
        var uintC actuallen = len + 1;
-       var cl_LF eps = scale_float(cl_I_to_LF(1,actuallen),-intDsize*(sintL)actuallen);
+       var cl_LF eps = scale_float(cl_I_to_LF(1,actuallen),-intDsize*(sintC)actuallen);
        var cl_I m2 = m*m;
        var cl_LF fterm = cl_I_to_LF(1,actuallen)/m;
        var cl_LF fsum = fterm;
-       for (var uintL n = 1; fterm >= eps; n++) {
+       for (var uintC n = 1; fterm >= eps; n++) {
                fterm = fterm/m2;
                fterm = cl_LF_shortenwith(fterm,eps);
                fsum = fsum + LF_to_LF(fterm/(2*n+1),actuallen);
@@ -51,20 +51,20 @@ const cl_LF atanh_recip_1b (cl_I m, uintC len)
        var cl_I m2 = m*m;
        var cl_I fterm = floor1((cl_I)1 << (intDsize*actuallen), m);
        var cl_I fsum = fterm;
-       for (var uintL n = 1; fterm > 0; n++) {
+       for (var uintC n = 1; fterm > 0; n++) {
                fterm = floor1(fterm,m2);
                fsum = fsum + floor1(fterm,2*n+1);
        }
-       return scale_float(cl_I_to_LF(fsum,len),-intDsize*(sintL)actuallen);
+       return scale_float(cl_I_to_LF(fsum,len),-intDsize*(sintC)actuallen);
 }
 
 const cl_LF atanh_recip_1c (cl_I m, uintC len)
 {
        var uintC actuallen = len + 1;
        var cl_I m2 = m*m;
-       var sintL N = (sintL)(0.69314718*intDsize/2*actuallen/log(double_approx(m))) + 1;
+       var sintC N = (sintC)(0.69314718*intDsize/2*actuallen/log(double_approx(m))) + 1;
        var cl_I num = 0, den = 1; // "lazy rational number"
-       for (sintL n = N-1; n>=0; n--) {
+       for (sintC n = N-1; n>=0; n--) {
                // Multiply sum with 1/m^2:
                den = den * m2;
                // Add 1/(2n+1):
@@ -80,11 +80,11 @@ const cl_LF atanh_recip_1d (cl_I m, uintC len)
 {
        var uintC actuallen = len + 1;
        var cl_I m2 = m*m;
-       var uintL N = (uintL)(0.69314718*intDsize/2*actuallen/log(double_approx(m))) + 1;
+       var uintC N = (uintC)(0.69314718*intDsize/2*actuallen/log(double_approx(m))) + 1;
        CL_ALLOCA_STACK;
        var cl_I* bv = (cl_I*) cl_alloca(N*sizeof(cl_I));
        var cl_I* qv = (cl_I*) cl_alloca(N*sizeof(cl_I));
-       var uintL n;
+       var uintC n;
        for (n = 0; n < N; n++) {
                new (&bv[n]) cl_I ((cl_I)(2*n+1));
                new (&qv[n]) cl_I (n==0 ? m : m2);
@@ -106,11 +106,11 @@ const cl_LF atanh_recip_1d (cl_I m, uintC len)
 const cl_LF atanh_recip_2a (cl_I m, uintC len)
 {
        var uintC actuallen = len + 1;
-       var cl_LF eps = scale_float(cl_I_to_LF(1,actuallen),-intDsize*(sintL)actuallen);
+       var cl_LF eps = scale_float(cl_I_to_LF(1,actuallen),-intDsize*(sintC)actuallen);
        var cl_I m2 = m*m-1;
        var cl_LF fterm = cl_I_to_LF(m,actuallen)/m2;
        var cl_LF fsum = fterm;
-       for (var uintL n = 1; fterm >= eps; n++) {
+       for (var uintC n = 1; fterm >= eps; n++) {
                fterm = The(cl_LF)((2*n)*fterm)/((2*n+1)*m2);
                fterm = cl_LF_shortenwith(fterm,eps);
                if ((n % 2) == 0)
@@ -127,23 +127,23 @@ const cl_LF atanh_recip_2b (cl_I m, uintC len)
        var cl_I m2 = m*m-1;
        var cl_I fterm = floor1((cl_I)m << (intDsize*actuallen), m2);
        var cl_I fsum = fterm;
-       for (var uintL n = 1; fterm > 0; n++) {
+       for (var uintC n = 1; fterm > 0; n++) {
                fterm = floor1((2*n)*fterm,(2*n+1)*m2);
                if ((n % 2) == 0)
                        fsum = fsum + fterm;
                else
                        fsum = fsum - fterm;
        }
-       return scale_float(cl_I_to_LF(fsum,len),-intDsize*(sintL)actuallen);
+       return scale_float(cl_I_to_LF(fsum,len),-intDsize*(sintC)actuallen);
 }
 
 const cl_LF atanh_recip_2c (cl_I m, uintC len)
 {
        var uintC actuallen = len + 1;
        var cl_I m2 = m*m-1;
-       var uintL N = (uintL)(0.69314718*intDsize*actuallen/log(double_approx(m2))) + 1;
+       var uintC N = (uintC)(0.69314718*intDsize*actuallen/log(double_approx(m2))) + 1;
        var cl_I num = 0, den = 1; // "lazy rational number"
-       for (uintL n = N; n>0; n--) {
+       for (uintC n = N; n>0; n--) {
                // Multiply sum with -(2n)/(2n+1)(m^2+1):
                num = num * (2*n);
                den = - den * ((2*n+1)*m2);
@@ -160,11 +160,11 @@ const cl_LF atanh_recip_2d (cl_I m, uintC len)
 {
        var uintC actuallen = len + 1;
        var cl_I m2 = m*m-1;
-       var uintL N = (uintL)(0.69314718*intDsize*actuallen/log(double_approx(m2))) + 1;
+       var uintC N = (uintC)(0.69314718*intDsize*actuallen/log(double_approx(m2))) + 1;
        CL_ALLOCA_STACK;
        var cl_I* pv = (cl_I*) cl_alloca(N*sizeof(cl_I));
        var cl_I* qv = (cl_I*) cl_alloca(N*sizeof(cl_I));
-       var uintL n;
+       var uintC n;
        new (&pv[0]) cl_I (m);
        new (&qv[0]) cl_I (m2);
        for (n = 1; n < N; n++) {
@@ -195,7 +195,7 @@ int main (int argc, char * argv[])
        if (argc < 2)
                exit(1);
        cl_I m = (cl_I)argv[1];
-       uintL len = atoi(argv[2]);
+       uintC len = atol(argv[2]);
        cl_LF p;
        ln(cl_I_to_LF(1000,len+10)); // fill cache
        // Method 1.
index ed83e275dc77426aed8c275bee2c5a14f91a8ab8..e0d6d98e8ea9b4261c2e40055178680289adf00c 100644 (file)
@@ -25,9 +25,9 @@ template <class T> struct cl_GV_vectorops;
 template <class T>
 class cl_GV_inner {
 protected:
-       uintL len; // number of elements
+       uintC len; // number of elements
 public:
-       uintL length () const; // number of elements
+       uintC length () const; // number of elements
        cl_GV_vectorops<T>* vectorops; // get/set element
        const cl_GV_index<T> operator[] (unsigned long index);
        const cl_GV_constindex<T> operator[] (unsigned long index) const;
@@ -39,7 +39,7 @@ public:
        const cl_GV_constindex<T> operator[] (int index) const;
 public: /* ugh */
        // Constructor.
-       cl_GV_inner (uintL l, cl_GV_vectorops<T>* ops) : len (l), vectorops (ops) {}
+       cl_GV_inner (uintC l, cl_GV_vectorops<T>* ops) : len (l), vectorops (ops) {}
 public:
        // Destructor.
        ~cl_GV_inner ();
@@ -63,10 +63,10 @@ class cl_GV_index {
        // through [].
 public:
        cl_GV_inner<T>* vec;
-       uintL index;
+       uintC index;
        operator T () const;
        // Constructor:
-       cl_GV_index (cl_GV_inner<T>* v, uintL i) : vec (v), index (i) {}
+       cl_GV_index (cl_GV_inner<T>* v, uintC i) : vec (v), index (i) {}
        // Assignment operator.
        void operator= (const T& x) const;
 #if (defined(__sparc__) || defined(__sparc64__) || defined(__mips__) || defined(__mips64__)) && !defined(__GNUC__) // maybe an SGI CC and Sun CC bug?
@@ -88,10 +88,10 @@ class cl_GV_constindex {
        // through []. It lacks the assignment operator.
 public:
        const cl_GV_inner<T>* vec;
-       uintL index;
+       uintC index;
        operator T () const;
        // Constructor:
-       cl_GV_constindex (const cl_GV_inner<T>* v, uintL i) : vec (v), index (i) {}
+       cl_GV_constindex (const cl_GV_inner<T>* v, uintC i) : vec (v), index (i) {}
 private:
 // No default constructor, assignment operator.
        cl_GV_constindex ();
@@ -100,16 +100,16 @@ private:
 
 template <class T>
 struct cl_GV_vectorops {
-       const T (*element) (const cl_GV_inner<T>* vec, uintL index);
-       void (*set_element) (cl_GV_inner<T>* vec, uintL index, const T& x);
+       const T (*element) (const cl_GV_inner<T>* vec, uintC index);
+       void (*set_element) (cl_GV_inner<T>* vec, uintC index, const T& x);
        void (*do_delete) (cl_GV_inner<T>* vec);
-       void (*copy_elements) (const cl_GV_inner<T>* srcvec, uintL srcindex, cl_GV_inner<T>* destvec, uintL destindex, uintL count);
+       void (*copy_elements) (const cl_GV_inner<T>* srcvec, uintC srcindex, cl_GV_inner<T>* destvec, uintC destindex, uintC count);
 };
 
 // All member functions are inline.
 
 template <class T>
-inline uintL cl_GV_inner<T>::length () const
+inline uintC cl_GV_inner<T>::length () const
 {
        return len;
 }
@@ -219,7 +219,7 @@ template <class T, class BASE>
 struct cl_GV : public BASE {
 public:
        // Length.
-       uintL length () const
+       uintC length () const
        {
                return ((const cl_heap_GV<T> *) this->pointer)->v.length();
        }
@@ -250,7 +250,7 @@ public:
        cl_GV& operator= (const cl_GV&);
        // Copy a piece of a vector into another vector.
        // (Both vectors must be of the same type. Overlapping not allowed.)
-       static void copy_elements (const cl_GV& src, uintL srcindex, cl_GV& dest, uintL destindex, uintL count)
+       static void copy_elements (const cl_GV& src, uintC srcindex, cl_GV& dest, uintC destindex, uintC count)
        {
                const cl_heap_GV<T> * hsrc = (const cl_heap_GV<T> *) src.pointer;
                cl_heap_GV<T> * hdest = (cl_heap_GV<T> *) dest.pointer;
index 60cd180341521580b4aaeb9dba05cfccd067b629..d04205e212c0aca78813c45438ca35d13504f06b 100644 (file)
@@ -19,7 +19,7 @@ public:
        // Constructors.
        cl_GV_N ();
        cl_GV_N (const cl_GV_N&);
-       explicit cl_GV_N (uintL len);
+       explicit cl_GV_N (uintC len);
        // Assignment operators.
        cl_GV_N& operator= (const cl_GV_N&);
        // Private pointer manipulations.
@@ -28,7 +28,7 @@ public:
 };
 inline cl_GV_N::cl_GV_N (const cl_GV_N& x) : cl_GV<cl_N,cl_GV_number> (as_cl_private_thing(x)) {}
 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_GV_N,cl_GV_N)
-inline cl_GV_N::cl_GV_N (uintL len)
+inline cl_GV_N::cl_GV_N (uintC len)
        : cl_GV<cl_N,cl_GV_number> ((cl_heap_GV_N*) cl_make_heap_GV_number(len)) {}
 inline cl_GV_N::cl_GV_N ()
        : cl_GV<cl_N,cl_GV_number> ((cl_heap_GV_N*) (cl_heap_GV_number*) cl_null_GV_number) {}
index 712c0bd404b2af211b65ffd25b244b1f1406e975..5dd2b79ffaf1ae8b43a44977efa4953adf5ada33 100644 (file)
@@ -17,7 +17,7 @@ template <>
 struct cl_heap_GV<cl_I> : cl_heap {
        cl_GV_inner<cl_I> v;
        // here room for the elements
-       sintL maxbits () const;
+       sintC maxbits () const;
 };
 typedef cl_heap_GV<cl_I> cl_heap_GV_I;
 
@@ -27,13 +27,13 @@ public:
        cl_GV_I ();
        cl_GV_I (const cl_GV_I&);
        // Create a vector of unconstrained integers.
-       explicit cl_GV_I (uintL len);
+       explicit cl_GV_I (uintC len);
        // Create a vector of m-bit integers (>=0, <2^m).
-       cl_GV_I (uintL len, sintL m);
+       cl_GV_I (uintC len, sintC m);
        // Assignment operators.
        cl_GV_I& operator= (const cl_GV_I&);
        // Number m of bits allowed per element (-1 if unconstrained).
-       sintL maxbits () const
+       sintC maxbits () const
        {
                return ((const cl_heap_GV_I *) pointer)->maxbits();
        }
@@ -43,11 +43,11 @@ public:
 };
 inline cl_GV_I::cl_GV_I (const cl_GV_I& x) : cl_GV<cl_I,cl_GV_RA> (as_cl_private_thing(x)) {}
 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_GV_I,cl_GV_I)
-extern cl_heap_GV_I* cl_make_heap_GV_I (uintL len);
-inline cl_GV_I::cl_GV_I (uintL len)
+extern cl_heap_GV_I* cl_make_heap_GV_I (uintC len);
+inline cl_GV_I::cl_GV_I (uintC len)
        : cl_GV<cl_I,cl_GV_RA> (cl_make_heap_GV_I(len)) {}
-extern cl_heap_GV_I* cl_make_heap_GV_I (uintL len, sintL m);
-inline cl_GV_I::cl_GV_I (uintL len, sintL m)
+extern cl_heap_GV_I* cl_make_heap_GV_I (uintC len, sintC m);
+inline cl_GV_I::cl_GV_I (uintC len, sintC m)
        : cl_GV<cl_I,cl_GV_RA> (cl_make_heap_GV_I(len,m)) {}
 
 // Private pointer manipulations. Never throw away a `struct cl_heap_GV_I *'!
index 4dc7ccbeaf5c762d3a4d14ef60210e9393077069..8929ef4e686ae21d58bb014a7d55598ae9457aef 100644 (file)
@@ -24,11 +24,11 @@ public:
        cl_GV_MI ();
        cl_GV_MI (const cl_GV_MI&);
        // Create a vector of modular integers.
-       cl_GV_MI (uintL len, cl_heap_modint_ring* R);
+       cl_GV_MI (uintC len, cl_heap_modint_ring* R);
        // Assignment operators.
        cl_GV_MI& operator= (const cl_GV_MI&);
        // Number m of bits allowed per element (-1 if unconstrained).
-       sintL maxbits () const
+       sintC maxbits () const
        {
                return ((const cl_heap_GV_I *) pointer)->maxbits();
        }
@@ -37,7 +37,7 @@ inline cl_GV_MI::cl_GV_MI (const cl_GV_MI& x) : cl_GV<_cl_MI,cl_GV_any> (as_cl_p
 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_GV_MI,cl_GV_MI)
 inline cl_GV_MI::cl_GV_MI ()
        : cl_GV<_cl_MI,cl_GV_any> ((cl_heap_GV_MI*) (cl_heap_GV_I*) cl_null_GV_I) {}
-inline cl_GV_MI::cl_GV_MI (uintL len, cl_heap_modint_ring* R)
+inline cl_GV_MI::cl_GV_MI (uintC len, cl_heap_modint_ring* R)
        : cl_GV<_cl_MI,cl_GV_any> ((cl_heap_GV_MI*) cl_make_heap_GV_I(len,R->bits)) {}
 
 // Copy a vector.
index 14d899dad985defde7752f82c785fdb02d32cb90..29886caa20a45872eb34bf4aaf38e83f9a813099 100644 (file)
@@ -15,7 +15,7 @@ public:
        // Constructors.
        cl_GV_number ();
        cl_GV_number (const cl_GV_number&);
-       explicit cl_GV_number (uintL len);
+       explicit cl_GV_number (uintC len);
        // Assignment operators.
        cl_GV_number& operator= (const cl_GV_number&);
        // Private pointer manipulations.
@@ -24,8 +24,8 @@ public:
 };
 inline cl_GV_number::cl_GV_number (const cl_GV_number& x) : cl_GV<cl_number,cl_GV_any> (as_cl_private_thing(x)) {}
 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_GV_number,cl_GV_number)
-extern cl_heap_GV_number* cl_make_heap_GV_number (uintL len);
-inline cl_GV_number::cl_GV_number (uintL len)
+extern cl_heap_GV_number* cl_make_heap_GV_number (uintC len);
+inline cl_GV_number::cl_GV_number (uintC len)
        : cl_GV<cl_number,cl_GV_any> (cl_make_heap_GV_number(len)) {}
 
 // Private pointer manipulations. Never throw away a `struct cl_heap_GV_number *'!
index d585206dd0bd288328b5af8161664984a9a5b0a9..5aaa240a072878f42ffef82e4de8ace6768750d0 100644 (file)
@@ -19,7 +19,7 @@ public:
        // Constructors.
        cl_GV_RA ();
        cl_GV_RA (const cl_GV_RA&);
-       explicit cl_GV_RA (uintL len);
+       explicit cl_GV_RA (uintC len);
        // Assignment operators.
        cl_GV_RA& operator= (const cl_GV_RA&);
        // Private pointer manipulations.
@@ -28,7 +28,7 @@ public:
 };
 inline cl_GV_RA::cl_GV_RA (const cl_GV_RA& x) : cl_GV<cl_RA,cl_GV_R> (as_cl_private_thing(x)) {}
 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_GV_RA,cl_GV_RA)
-inline cl_GV_RA::cl_GV_RA (uintL len)
+inline cl_GV_RA::cl_GV_RA (uintC len)
        : cl_GV<cl_RA,cl_GV_R> ((cl_heap_GV_RA*) cl_make_heap_GV_number(len)) {}
 inline cl_GV_RA::cl_GV_RA ()
        : cl_GV<cl_RA,cl_GV_R> ((cl_heap_GV_RA*) (cl_heap_GV_number*) cl_null_GV_number) {}
index 510b73959c5ffedba33639aebd37e21bc2939dff..a57c56fd08b28c6f39475dc8ffa3edb75de7adab 100644 (file)
@@ -19,7 +19,7 @@ public:
        // Constructors.
        cl_GV_R ();
        cl_GV_R (const cl_GV_R&);
-       explicit cl_GV_R (uintL len);
+       explicit cl_GV_R (uintC len);
        // Assignment operators.
        cl_GV_R& operator= (const cl_GV_R&);
        // Private pointer manipulations.
@@ -28,7 +28,7 @@ public:
 };
 inline cl_GV_R::cl_GV_R (const cl_GV_R& x) : cl_GV<cl_R,cl_GV_N> (as_cl_private_thing(x)) {}
 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_GV_R,cl_GV_R)
-inline cl_GV_R::cl_GV_R (uintL len)
+inline cl_GV_R::cl_GV_R (uintC len)
        : cl_GV<cl_R,cl_GV_N> ((cl_heap_GV_R*) cl_make_heap_GV_number(len)) {}
 inline cl_GV_R::cl_GV_R ()
        : cl_GV<cl_R,cl_GV_N> ((cl_heap_GV_R*) (cl_heap_GV_number*) cl_null_GV_number) {}
index 7c05e807799819c2c11aac8ed948eca65621d072..011bb13554265679ef72e965ba7b9a441c08af27 100644 (file)
@@ -40,13 +40,13 @@ template <class T> class cl_SV_inner;
 template <class T>
 class cl_SV_inner {
 protected:
-       uintL len; // number of elements
+       uintC len; // number of elements
 private:
 //     T data[]; // the elements
        T * data() { return (T *) (this+1); }
        const T * data() const { return (const T *) (this+1); }
 public:
-       uintL length () const { return len; } // number of elements
+       uintC length () const { return len; } // number of elements
        const T & operator[] (unsigned long index) const
        {
                #ifndef CL_SV_NO_RANGECHECKS
@@ -76,7 +76,7 @@ public:
        { return operator[]((unsigned long)index); }
 public: /* ugh */
        // Constructor.
-       cl_SV_inner (uintL l) : len (l) {}
+       cl_SV_inner (uintC l) : len (l) {}
 public:
        // Destructor.
        ~cl_SV_inner ();
@@ -95,7 +95,7 @@ private:
 template <class T>
 inline cl_SV_inner<T>::~cl_SV_inner ()
 {
-       uintL i = len;
+       uintC i = len;
        while (i > 0) {
                i--;
                data()[i].~T();
@@ -115,7 +115,7 @@ template <class T, class BASE>
 struct cl_SV : public BASE {
 public:
        // Length.
-       uintL length () const
+       uintC length () const
        {
                return ((const cl_heap_SV<T> *) this->pointer)->v.length();
        }
index a7272eef741e0c96376ef07a42f930c1d5272ae9..6e0272782f530b6891968edea3ca9b7ca73dd5c9 100644 (file)
@@ -19,7 +19,7 @@ public:
        // Constructors.
        cl_SV_N () : cl_SV<cl_N,cl_SV_number> ((cl_heap_SV_N*) (cl_heap_SV_number*) cl_null_SV_number) {};
        cl_SV_N (const cl_SV_N&);
-       explicit cl_SV_N (uintL len) : cl_SV<cl_N,cl_SV_number> ((cl_heap_SV_N*) cl_make_heap_SV_number(len)) {};
+       explicit cl_SV_N (uintC len) : cl_SV<cl_N,cl_SV_number> ((cl_heap_SV_N*) cl_make_heap_SV_number(len)) {};
        // Assignment operators.
        cl_SV_N& operator= (const cl_SV_N&);
        // Private pointer manipulations.
index 4bf03d8e8a5642a89e48790f13281ac1b3a37339..aca62cc2a4d95af66b44954ebee4391446729017 100644 (file)
@@ -19,7 +19,7 @@ public:
        // Constructors.
        cl_SV_I () : cl_SV<cl_I,cl_SV_RA> ((cl_heap_SV_I*) (cl_heap_SV_number*) cl_null_SV_number) {};
        cl_SV_I (const cl_SV_I&);
-       explicit cl_SV_I (uintL len) : cl_SV<cl_I,cl_SV_RA> ((cl_heap_SV_I*) cl_make_heap_SV_number(len)) {};
+       explicit cl_SV_I (uintC len) : cl_SV<cl_I,cl_SV_RA> ((cl_heap_SV_I*) cl_make_heap_SV_number(len)) {};
        // Assignment operators.
        cl_SV_I& operator= (const cl_SV_I&);
 };
index 810f26c9265b273c8625ccd750653d7378fe6cbf..845142d631728e712d0480059fbec8f197b50c35 100644 (file)
@@ -16,7 +16,7 @@ public:
        // Constructors.
        cl_SV_number ();
        cl_SV_number (const cl_SV_number&);
-       explicit cl_SV_number (uintL len);
+       explicit cl_SV_number (uintC len);
        // Assignment operators.
        cl_SV_number& operator= (const cl_SV_number&);
        // Private pointer manipulations.
@@ -27,10 +27,10 @@ public:
 inline cl_SV_number::cl_SV_number (const cl_SV_number& x) : cl_SV<cl_number,cl_SV_any> (as_cl_private_thing(x)) {}
 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_SV_number,cl_SV_number)
 // Returns a new simple vector with uninitialized contents.
-extern cl_heap_SV_number* cl_make_heap_SV_number_uninit (uintL len);
+extern cl_heap_SV_number* cl_make_heap_SV_number_uninit (uintC len);
 // Returns a new simple vector with all elements initialized to 0.
-extern cl_heap_SV_number* cl_make_heap_SV_number (uintL len);
-inline cl_SV_number::cl_SV_number (uintL len)
+extern cl_heap_SV_number* cl_make_heap_SV_number (uintC len);
+inline cl_SV_number::cl_SV_number (uintC len)
        : cl_SV<cl_number,cl_SV_any> (cl_make_heap_SV_number(len)) {}
 
 // Private pointer manipulations. Never throw away a `struct cl_heap_SV_number *'!
index 8774dee3369ff9d55c9f04bacc00ce6116fbbc6c..b7003f88bc34723eb75577dcad59997c31de336b 100644 (file)
@@ -19,7 +19,7 @@ public:
        // Constructors.
        cl_SV_RA () : cl_SV<cl_RA,cl_SV_R> ((cl_heap_SV_RA*) (cl_heap_SV_number*) cl_null_SV_number) {};
        cl_SV_RA (const cl_SV_RA&);
-       explicit cl_SV_RA (uintL len) : cl_SV<cl_RA,cl_SV_R> ((cl_heap_SV_RA*) cl_make_heap_SV_number(len)) {};
+       explicit cl_SV_RA (uintC len) : cl_SV<cl_RA,cl_SV_R> ((cl_heap_SV_RA*) cl_make_heap_SV_number(len)) {};
        // Assignment operators.
        cl_SV_RA& operator= (const cl_SV_RA&);
        // Private pointer manipulations.
index 7a01f5f212378dba6189582d85053b2130ca52a0..d297022e7b44c93f0daaeb4107238dc49978521d 100644 (file)
@@ -19,7 +19,7 @@ public:
        // Constructors.
        cl_SV_R () : cl_SV<cl_R,cl_SV_N> ((cl_heap_SV_R*) (cl_heap_SV_number*) cl_null_SV_number) {};
        cl_SV_R (const cl_SV_R&);
-       explicit cl_SV_R (uintL len) : cl_SV<cl_R,cl_SV_N> ((cl_heap_SV_R*) cl_make_heap_SV_number(len)) {};
+       explicit cl_SV_R (uintC len) : cl_SV<cl_R,cl_SV_N> ((cl_heap_SV_R*) cl_make_heap_SV_number(len)) {};
        // Assignment operators.
        cl_SV_R& operator= (const cl_SV_R&);
        // Private pointer manipulations.
index d5ac3bb844d1a7a46504423a76474699bc59a057..d370afd814cac71f09fd8d01609b8811eca64d85 100644 (file)
@@ -16,7 +16,7 @@ public:
        // Constructors.
        cl_SV_ringelt ();
        cl_SV_ringelt (const cl_SV_ringelt&);
-       explicit cl_SV_ringelt (uintL len);
+       explicit cl_SV_ringelt (uintC len);
        // Assignment operators.
        cl_SV_ringelt& operator= (const cl_SV_ringelt&);
        // Private pointer manipulations.
@@ -27,10 +27,10 @@ public:
 inline cl_SV_ringelt::cl_SV_ringelt (const cl_SV_ringelt& x) : cl_SV<_cl_ring_element,cl_SV_any> (as_cl_private_thing(x)) {}
 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_SV_ringelt,cl_SV_ringelt)
 // Returns a new simple vector with uninitialized contents.
-extern cl_heap_SV_ringelt* cl_make_heap_SV_ringelt_uninit (uintL len);
+extern cl_heap_SV_ringelt* cl_make_heap_SV_ringelt_uninit (uintC len);
 // Returns a new simple vector with all elements initialized to some value.
-extern cl_heap_SV_ringelt* cl_make_heap_SV_ringelt (uintL len);
-inline cl_SV_ringelt::cl_SV_ringelt (uintL len)
+extern cl_heap_SV_ringelt* cl_make_heap_SV_ringelt (uintC len);
+inline cl_SV_ringelt::cl_SV_ringelt (uintC len)
        : cl_SV<_cl_ring_element,cl_SV_any> (cl_make_heap_SV_ringelt(len)) {}
 
 // Private pointer manipulations.
index fde8a801f476ae34431e6bdafcb333385a866695..2b9d0c7c6a9dd36114cc6eb3f2b0d7d4a9e22f8f 100644 (file)
@@ -256,12 +256,12 @@ inline sintL float_radix (const cl_DF& x)
 extern const cl_DF float_sign (const cl_DF& x);
 
 // float_digits(x) liefert (float-digits x), wo x ein Float ist.
-// < ergebnis: ein uintL >0
-extern uintL float_digits (const cl_DF& x);
+// < ergebnis: ein uintC >0
+extern uintC float_digits (const cl_DF& x);
 
 // float_precision(x) liefert (float-precision x), wo x ein Float ist.
-// < ergebnis: ein uintL >=0
-extern uintL float_precision (const cl_DF& x);
+// < ergebnis: ein uintC >=0
+extern uintC float_precision (const cl_DF& x);
 
 
 // integer_decode_float(x) liefert zu einem Float x: (integer-decode-float x).
@@ -272,7 +272,7 @@ extern const cl_idecoded_float integer_decode_float (const cl_DF& x);
 
 
 // scale_float(x,delta) liefert x*2^delta, wo x ein DF ist.
-extern const cl_DF scale_float (const cl_DF& x, sintL delta);
+extern const cl_DF scale_float (const cl_DF& x, sintC delta);
 extern const cl_DF scale_float (const cl_DF& x, const cl_I& delta);
 
 
index 06441082ac15d12047bee93c076e14d880250a6f..d6903273d7406f06183af667c906d5897af5aee9 100644 (file)
@@ -256,12 +256,12 @@ inline sintL float_radix (const cl_FF& x)
 extern const cl_FF float_sign (const cl_FF& x);
 
 // float_digits(x) liefert (float-digits x), wo x ein Float ist.
-// < ergebnis: ein uintL >0
-extern uintL float_digits (const cl_FF& x);
+// < ergebnis: ein uintC >0
+extern uintC float_digits (const cl_FF& x);
 
 // float_precision(x) liefert (float-precision x), wo x ein Float ist.
-// < ergebnis: ein uintL >=0
-extern uintL float_precision (const cl_FF& x);
+// < ergebnis: ein uintC >=0
+extern uintC float_precision (const cl_FF& x);
 
 
 // integer_decode_float(x) liefert zu einem Float x: (integer-decode-float x).
@@ -272,7 +272,7 @@ extern const cl_idecoded_float integer_decode_float (const cl_FF& x);
 
 
 // scale_float(x,delta) liefert x*2^delta, wo x ein FF ist.
-extern const cl_FF scale_float (const cl_FF& x, sintL delta);
+extern const cl_FF scale_float (const cl_FF& x, sintC delta);
 extern const cl_FF scale_float (const cl_FF& x, const cl_I& delta);
 
 
index 471cb36644c038cc4bd3d157b9928a3c164d2a05..4f9945ced91796175fc7d174c801f858005b9dd8 100644 (file)
@@ -467,12 +467,12 @@ extern const cl_F float_sign (const cl_F& x);
 extern const cl_F float_sign (const cl_F& x, const cl_F& y);
 
 // float_digits(x) liefert (float-digits x), wo x ein Float ist.
-// < ergebnis: ein uintL >0
-extern uintL float_digits (const cl_F& x);
+// < ergebnis: ein uintC >0
+extern uintC float_digits (const cl_F& x);
 
 // float_precision(x) liefert (float-precision x), wo x ein Float ist.
-// < ergebnis: ein uintL >=0
-extern uintL float_precision (const cl_F& x);
+// < ergebnis: ein uintC >=0
+extern uintC float_precision (const cl_F& x);
 
 // Returns the floating point format of a float.
 inline float_format_t float_format (const cl_F& x)
@@ -491,7 +491,7 @@ extern const cl_RA rational (const cl_F& x);
 
 
 // scale_float(x,delta) liefert x*2^delta, wo x ein Float ist.
-extern const cl_F scale_float (const cl_F& x, sintL delta);
+extern const cl_F scale_float (const cl_F& x, sintC delta);
 extern const cl_F scale_float (const cl_F& x, const cl_I& delta);
 
 
index d5a8eb3d4d3fc2580b8ffda61f663aaff15e9c86..72b848fed01d5d19a4c8540566d2b459976ab8d8 100644 (file)
@@ -127,7 +127,7 @@ extern cl_boolean logtest (const cl_I& x, const cl_I& y);
 
 // Prüft, ob (LOGBITP x y), wo x und y Integers sind.
 // Ergebnis: /=0, wenn ja; =0, wenn nein.
-extern cl_boolean logbitp (uintL x, const cl_I& y);
+extern cl_boolean logbitp (uintC x, const cl_I& y);
 extern cl_boolean logbitp (const cl_I& x, const cl_I& y);
 
 // Prüft, ob (ODDP x), wo x ein Integer ist.
@@ -140,21 +140,21 @@ inline cl_boolean evenp (const cl_I& x)
        { return (cl_boolean) (!oddp(x)); }
 
 // (ASH x y), wo x und y Integers sind. Ergebnis Integer.
-extern const cl_I ash (const cl_I& x, sintL y);
+extern const cl_I ash (const cl_I& x, sintC y);
 extern const cl_I ash (const cl_I& x, const cl_I& y);
 
 // (LOGCOUNT x), wo x ein Integer ist. Ergebnis uintL.
-extern uintL logcount (const cl_I& x);
+extern uintC logcount (const cl_I& x);
 
 // (INTEGER-LENGTH x), wo x ein Integer ist. Ergebnis uintL.
-extern uintL integer_length (const cl_I& x);
+extern uintC integer_length (const cl_I& x);
 
 // (ORD2 x) = max{n>=0: 2^n | x }, wo x ein Integer /=0 ist. Ergebnis uintL.
-extern uintL ord2 (const cl_I& x);
+extern uintC ord2 (const cl_I& x);
 
 // power2p(x) stellt fest, ob ein Integer x>0 eine Zweierpotenz ist.
 // Ergebnis: n>0, wenn x=2^(n-1), 0 sonst.
-extern uintL power2p (const cl_I& x);
+extern uintC power2p (const cl_I& x);
 
 inline const cl_I operator| (const cl_I& x, const cl_I& y)
        { return logior(x,y); }
@@ -227,11 +227,11 @@ inline const cl_I operator- (const cl_I& x, const unsigned long y)
 extern const cl_I abs (const cl_I& x);
 
 // Shifts.
-inline const cl_I operator<< (const cl_I& x, sintL y) // assume 0 <= y < 2^31
+inline const cl_I operator<< (const cl_I& x, sintC y) // assume 0 <= y < 2^(intCsize-1)
        { return ash(x,y); }
 inline const cl_I operator<< (const cl_I& x, const cl_I& y) // assume y >= 0
        { return ash(x,y); }
-inline const cl_I operator>> (const cl_I& x, sintL y) // assume 0 <= y < 2^31
+inline const cl_I operator>> (const cl_I& x, sintC y) // assume 0 <= y < 2^(intCsize-1)
        { return ash(x,-y); }
 inline const cl_I operator>> (const cl_I& x, const cl_I& y) // assume y >= 0
        { return ash(x,-y); }
@@ -274,10 +274,10 @@ extern cl_boolean zerop (const cl_I& x);
 // BYTE-Operationen auf Integers
 
 struct cl_byte {
-       uintL size;
-       uintL position;
+       uintC size;
+       uintC position;
 // Konstruktor:
-       cl_byte (unsigned int s, unsigned int p) : size (s), position (p) {}
+       cl_byte (uintC s, uintC p) : size (s), position (p) {}
 };
 
 // (LDB byte n), wo n ein Integer ist.
@@ -562,11 +562,11 @@ inline cl_I& operator-= (cl_I& x, const unsigned long y) { return x = x - y; }
 inline cl_I& operator-- /* prefix */ (cl_I& x) { return x = minus1(x); }
 inline void operator-- /* postfix */ (cl_I& x, int dummy) { (void)dummy; x = minus1(x); }
 inline cl_I& operator*= (cl_I& x, const cl_I& y) { return x = x * y; }
-inline cl_I& operator<<= (cl_I& x, sintL y) // assume 0 <= y < 2^31
+inline cl_I& operator<<= (cl_I& x, sintC y) // assume 0 <= y < 2^(intCsize-1)
        { return x = x << y; }
 inline cl_I& operator<<= (cl_I& x, const cl_I& y) // assume y >= 0
        { return x = x << y; }
-inline cl_I& operator>>= (cl_I& x, sintL y) // assume 0 <= y < 2^31
+inline cl_I& operator>>= (cl_I& x, sintC y) // assume 0 <= y < 2^(intCsize-1)
        { return x = x >> y; }
 inline cl_I& operator>>= (cl_I& x, const cl_I& y) // assume y >= 0
        { return x = x >> y; }
index 440151bbffc490c39caf3e0db9555e5031f18872..24041d82754698f2539f0ecac623b040e747ce97 100644 (file)
@@ -346,12 +346,12 @@ inline sintL float_radix (const cl_LF& x)
 extern const cl_LF float_sign (const cl_LF& x);
 
 // float_digits(x) liefert (float-digits x), wo x ein Float ist.
-// < ergebnis: ein uintL >0
-extern uintL float_digits (const cl_LF& x);
+// < ergebnis: ein uintC >0
+extern uintC float_digits (const cl_LF& x);
 
 // float_precision(x) liefert (float-precision x), wo x ein Float ist.
-// < ergebnis: ein uintL >=0
-extern uintL float_precision (const cl_LF& x);
+// < ergebnis: ein uintC >=0
+extern uintC float_precision (const cl_LF& x);
 
 
 // integer_decode_float(x) liefert zu einem Float x: (integer-decode-float x).
@@ -362,7 +362,7 @@ extern const cl_idecoded_float integer_decode_float (const cl_LF& x);
 
 
 // scale_float(x,delta) liefert x*2^delta, wo x ein LF ist.
-extern const cl_LF scale_float (const cl_LF& x, sintL delta);
+extern const cl_LF scale_float (const cl_LF& x, sintC delta);
 extern const cl_LF scale_float (const cl_LF& x, const cl_I& delta);
 
 
index 59ae42fba22adefbea46dd18bc8b570b5967e143..90647caeea4ab9bd03e011680a5ea186fe5d177f 100644 (file)
@@ -342,7 +342,7 @@ public:
                return _retract(x);
        }
        // Miscellaneous.
-       sintL bits; // number of bits needed to represent a representative, or -1
+       sintC bits; // number of bits needed to represent a representative, or -1
        int log2_bits; // log_2(bits), or -1
        // Property operations.
        cl_property* get_property (const cl_symbol& key)
@@ -389,8 +389,8 @@ inline const cl_MI operator- (const cl_I& x, const cl_MI& y)
        { return y.ring()->minus(y.ring()->canonhom(x),y); }
 
 // Shifts.
-extern const cl_MI operator<< (const cl_MI& x, sintL y); // assume 0 <= y < 2^31
-extern const cl_MI operator>> (const cl_MI& x, sintL y); // assume m odd, 0 <= y < 2^31
+extern const cl_MI operator<< (const cl_MI& x, sintC y); // assume 0 <= y < 2^(intCsize-1)
+extern const cl_MI operator>> (const cl_MI& x, sintC y); // assume m odd, 0 <= y < 2^(intCsize-1)
 
 // Equality.
 inline bool operator== (const cl_MI& x, const cl_MI& y)
index cb3aa96aa3e38dfcae2249d0f9b34f2d06a02b1e..a95d65fef838f97ab4cb1414583681316d113c16 100644 (file)
@@ -236,12 +236,12 @@ inline sintL float_radix (const cl_SF& x)
 extern const cl_SF float_sign (const cl_SF& x);
 
 // float_digits(x) liefert (float-digits x), wo x ein Float ist.
-// < ergebnis: ein uintL >0
-extern uintL float_digits (const cl_SF& x);
+// < ergebnis: ein uintC >0
+extern uintC float_digits (const cl_SF& x);
 
 // float_precision(x) liefert (float-precision x), wo x ein Float ist.
-// < ergebnis: ein uintL >=0
-extern uintL float_precision (const cl_SF& x);
+// < ergebnis: ein uintC >=0
+extern uintC float_precision (const cl_SF& x);
 
 
 // integer_decode_float(x) liefert zu einem Float x: (integer-decode-float x).
@@ -252,7 +252,7 @@ extern const cl_idecoded_float integer_decode_float (const cl_SF& x);
 
 
 // scale_float(x,delta) liefert x*2^delta, wo x ein SF ist.
-extern const cl_SF scale_float (const cl_SF& x, sintL delta);
+extern const cl_SF scale_float (const cl_SF& x, sintC delta);
 extern const cl_SF scale_float (const cl_SF& x, const cl_I& delta);
 
 
index 1f956a42c8c6b1de62833821032966ef2a42062a..d23fcc7f1726aa246d544089d24ffb012e02c7c0 100644 (file)
@@ -85,6 +85,7 @@
   #define signean_minus -1
 
 // Integer type used for counters.
+// Constraint: sizeof(uintC) >= sizeof(uintL)
   #if (defined(HAVE_FAST_LONGLONG) && (defined(__alpha__) || defined(__ia64__) || defined(__powerpc64__) || defined(__x86_64__)))
     #define intCsize long_bitsize
     typedef long           sintC;
index 03dbfed11bb6b4193a9eb22e4a5d18e1df9acaf1..98b371e5d06d24987687d22a471ce41795b811c2 100644 (file)
@@ -1430,6 +1430,18 @@ inline uint32 mulu32_unchecked (uint32 arg1, uint32 arg2)
     }
 #endif
 
+// Bits einer uintC-Zahl zählen:
+// integerlengthC(digit,size=);
+// setzt size auf die höchste in digit vorkommende Bitnummer.
+// > digit: ein uintC >0
+// < size: >0, <=intCsize, mit 2^(size-1) <= digit < 2^size
+  #if (intCsize==32)
+    #define integerlengthC  integerlength32
+  #endif
+  #if (intCsize==64)
+    #define integerlengthC  integerlength64
+  #endif
+
 // Hintere Nullbits eines 32-Bit-Wortes zählen:
 // ord2_32(digit,count=);
 // setzt size auf die kleinste in digit vorkommende Bitnummer.
index 87306233c51cbad285c0e498104e027f2b222a68..5d0738ee3ad32c9e5fd0ced6036065a0cb9c0a2c 100644 (file)
@@ -55,12 +55,12 @@ namespace cln {
 //
 // Break-even-point. When in doubt, prefer to choose the standard algorithm.
 #if CL_USE_GMP
-  static inline cl_boolean cl_recip_suitable (uintL m, uintL n) // n <= m
+  static inline cl_boolean cl_recip_suitable (uintC m, uintC n) // n <= m
     { if (n < 2000)
         return cl_false;
       else // when n >= 4400/(m/n)^2, i.e. (m/66)^2 > n
-        { var uintL mq = floor(m,66);
-          if ((mq >= bit(16)) || ((uintL)(mq*mq) > n))
+        { var uintC mq = floor(m,66);
+          if ((mq >= bit(intCsize/2)) || (mq*mq > n))
             return cl_true;
           else
             return cl_false;
@@ -93,12 +93,12 @@ namespace cln {
 // 1.8*N / N : Newton for N >=  500
 // 1.9*N / N : Newton for N >=  500
 // 2.0*N / N : Newton for N >=  500
-  static inline cl_boolean cl_recip_suitable (uintL m, uintL n) // n <= m
+  static inline cl_boolean cl_recip_suitable (uintC m, uintC n) // n <= m
     { if (n < 500)
         return cl_false;
       else // when n >= 2100/(m/n)^2, i.e. (m/46)^2 > n
-        { var uintL mq = floor(m,46);
-          if ((mq >= bit(16)) || ((uintL)(mq*mq) > n))
+        { var uintC mq = floor(m,46);
+          if ((mq >= bit(intCsize/2)) || (mq*mq > n))
             return cl_true;
           else
             return cl_false;
index 8ae8621e36c626bcf67d1a9fdf5b525d69ce7f04..a6b96c8d6466d061dd81fc3db2ed9a4f7772f84e 100644 (file)
@@ -31,7 +31,7 @@ void recip2adic (uintC len, const uintD* a_LSDptr, uintD* dest_LSDptr)
        //   return 2*b-a*b^2 mod 2^(intDsize*2*n).
        CL_ALLOCA_STACK;
        var uintL k = 0; // number of Newton steps
-       var uintL n = len;
+       var uintC n = len;
        while (n >= recip2adic_threshold) {
                n = ceiling(n,2);
                k++;
@@ -47,13 +47,13 @@ void recip2adic (uintC len, const uintD* a_LSDptr, uintD* dest_LSDptr)
                var uintD* b2_LSDptr;
                var uintD* prod_LSDptr;
                num_stack_alloc(len+1,,b2_LSDptr=);
-               num_stack_alloc(2*(uintL)len,,prod_LSDptr=);
+               num_stack_alloc(2*len,,prod_LSDptr=);
                do {
                        // n = ceiling(len/2^k)
                        // Compute n2 = ceiling(len/2^(k-1)),
                        // then n = ceiling(n2/2).
                        k--;
-                       var uintL n2 = ((len-1)>>k)+1; // = 2*n or = 2*n-1
+                       var uintC n2 = ((len-1)>>k)+1; // = 2*n or = 2*n-1
                        // Set b := 2*b-a*b^2 mod 2^(intDsize*n2)
                        cl_UDS_mul_square(dest_LSDptr,n,b2_LSDptr); // b^2
                        cl_UDS_mul(b2_LSDptr,n2,a_LSDptr,n2,prod_LSDptr); // a*b^2
index 246ccd8301b6b37607a16eb05d0ddd9977b4234f..a9a5b84d71e2f6ba8a0ff4d3e1adc045abb996cc 100644 (file)
@@ -2489,12 +2489,12 @@ inline uintD divucopy_loop_down (uintD digit, const uintD* sourceptr, uintD* des
 // zusätzlich belegt wird.
 
 #define num_stack_array(need,low_zuweisung,high_zuweisung)  \
-  {var uintL __need = (uintL)(need);                           \
+  {var uintC __need = (uintC)(need);                           \
    var uintD* __array = cl_alloc_array(uintD,__need);          \
    unused (low_zuweisung &__array[0]); unused (high_zuweisung &__array[__need]); \
   }
 #define num_stack_small_array(need,low_zuweisung,high_zuweisung)  \
-  {var uintL __need = (uintL)(need);                           \
+  {var uintC __need = (uintC)(need);                           \
    var uintD* __array = cl_small_alloc_array(uintD,__need);    \
    unused (low_zuweisung &__array[0]); unused (high_zuweisung &__array[__need]); \
   }
@@ -2504,18 +2504,18 @@ inline uintD divucopy_loop_down (uintD digit, const uintD* sourceptr, uintD* des
   #define num_stack_small_alloc(need,MSDptr_zuweisung,LSDptr_zuweisung)  \
     num_stack_small_array(need,MSDptr_zuweisung,LSDptr_zuweisung)
   #define num_stack_alloc_1(need,MSDptr_zuweisung,LSDptr_zuweisung)  \
-    num_stack_array((uintL)(need)+1,MSDptr_zuweisung 1 + ,LSDptr_zuweisung)
+    num_stack_array((uintC)(need)+1,MSDptr_zuweisung 1 + ,LSDptr_zuweisung)
   #define num_stack_small_alloc_1(need,MSDptr_zuweisung,LSDptr_zuweisung)  \
-    num_stack_small_array((uintL)(need)+1,MSDptr_zuweisung 1 + ,LSDptr_zuweisung)
+    num_stack_small_array((uintC)(need)+1,MSDptr_zuweisung 1 + ,LSDptr_zuweisung)
 #else
   #define num_stack_alloc(need,MSDptr_zuweisung,LSDptr_zuweisung)  \
     num_stack_array(need,LSDptr_zuweisung,MSDptr_zuweisung)
   #define num_stack_small_alloc(need,MSDptr_zuweisung,LSDptr_zuweisung)  \
     num_stack_small_array(need,LSDptr_zuweisung,MSDptr_zuweisung)
   #define num_stack_alloc_1(need,MSDptr_zuweisung,LSDptr_zuweisung)  \
-    num_stack_array((uintL)(need)+1,LSDptr_zuweisung,MSDptr_zuweisung -1 + )
+    num_stack_array((uintC)(need)+1,LSDptr_zuweisung,MSDptr_zuweisung -1 + )
   #define num_stack_small_alloc_1(need,MSDptr_zuweisung,LSDptr_zuweisung)  \
-    num_stack_small_array((uintL)(need)+1,LSDptr_zuweisung,MSDptr_zuweisung -1 + )
+    num_stack_small_array((uintC)(need)+1,LSDptr_zuweisung,MSDptr_zuweisung -1 + )
 #endif
 
 
@@ -2585,7 +2585,7 @@ extern void cl_UDS_mul_square (const uintD* sourceptr, uintC len,
 // Ergebnis ist die UDS MSDptr/len/LSDptr, mit len=len1+len2, im Stack.
 // Dabei wird num_stack erniedrigt.
   #define UDS_UDS_mul_UDS(len1,LSDptr1,len2,LSDptr2, MSDptr_zuweisung,len_zuweisung,LSDptr_zuweisung)  \
-    var uintL CONCAT(len_from_UDSmul_,__LINE__) = (uintL)(len1) + (uintL)(len2); \
+    var uintC CONCAT(len_from_UDSmul_,__LINE__) = (uintC)(len1) + (uintC)(len2); \
     var uintD* CONCAT(LSDptr_from_UDSmul_,__LINE__);                           \
     unused (len_zuweisung CONCAT(len_from_UDSmul_,__LINE__));                  \
     num_stack_alloc(CONCAT(len_from_UDSmul_,__LINE__),MSDptr_zuweisung,LSDptr_zuweisung CONCAT(LSDptr_from_UDSmul_,__LINE__) =); \
@@ -2611,13 +2611,13 @@ extern void cl_UDS_mul_square (const uintD* sourceptr, uintC len,
   #define DS_DS_mul_DS(MSDptr1,len1,LSDptr1,MSDptr2,len2,LSDptr2, MSDptr_zuweisung,len_zuweisung,LSDptr_zuweisung)  \
     var uintD* MSDptr0;                                                        \
     var uintD* LSDptr0;                                                        \
-    var uintL len_from_DSmal = (uintL)(len1) + (uintL)(len2);          \
+    var uintC len_from_DSmal = (uintC)(len1) + (uintC)(len2);          \
     unused (len_zuweisung len_from_DSmal);                             \
     num_stack_alloc(len_from_DSmal,MSDptr_zuweisung MSDptr0 =,LSDptr_zuweisung LSDptr0 =); \
     var uintD MSD1_from_DSmal = mspref(MSDptr1,0);                     \
     var uintD MSD2_from_DSmal = mspref(MSDptr2,0);                     \
-    var uintL len1_from_DSmal = (len1);                                        \
-    var uintL len2_from_DSmal = (len2);                                        \
+    var uintC len1_from_DSmal = (len1);                                        \
+    var uintC len2_from_DSmal = (len2);                                        \
     if (MSD1_from_DSmal==0) { msprefnext(MSDptr0) = 0; len1_from_DSmal--; } \
     if (MSD2_from_DSmal==0) { msprefnext(MSDptr0) = 0; len2_from_DSmal--; } \
     cl_UDS_mul((LSDptr1),len1_from_DSmal,(LSDptr2),len2_from_DSmal,LSDptr0); \
index e1f94a411398ca0e504ab3a9094b11c5324a7b1b..5400e7f25b932c0a5512208f4c307945f232e924 100644 (file)
@@ -354,15 +354,20 @@ namespace cln {
   const unsigned int cl_fftm_threshold2 = 2*cl_fftm_threshold;
   //   len1 > cl_fftm_threshold1 && len2 > cl_fftm_threshold2
   //   && len1 >= cl_fftm_threshold1 + cl_fftm_threshold/(len2-cl_fftm_threshold1)*(cl_fftm_threshold-cl_fftm_threshold1).
-  static inline cl_boolean cl_fftm_suitable (uintL len1, uintL len2)
+  static inline cl_boolean cl_fftm_suitable (uintC len1, uintC len2)
     { if (len1 >= cl_fftm_threshold)
         return cl_true;
       if (len1 > cl_fftm_threshold1)
         if (len2 > cl_fftm_threshold2)
-          { var uint32 hi;
+          { const unsigned int prod_threshold = cl_fftm_threshold*(cl_fftm_threshold-cl_fftm_threshold1);
+            if (len1-cl_fftm_threshold1 >= prod_threshold)
+              return cl_true;
+            if (len2-cl_fftm_threshold1 >= prod_threshold)
+              return cl_true;
+            var uint32 hi;
             var uint32 lo;
             mulu32(len1-cl_fftm_threshold1,len2-cl_fftm_threshold1, hi=,lo=);
-            if (hi > 0 || lo >= cl_fftm_threshold*(cl_fftm_threshold-cl_fftm_threshold1))
+            if (hi > 0 || lo >= prod_threshold)
               return cl_true;
           }
       return cl_false;
index 0c1e7caf717c7367033b63c1a8b51cdc67abffaa..5d6eeaefc34f3d243fb92257a0e0ad3e140abf4c 100644 (file)
@@ -384,9 +384,9 @@ static inline void mul (const fftc_complex& a, const fftc_complex& b, fftc_compl
 #ifndef _BIT_REVERSE
 #define _BIT_REVERSE
 // Reverse an n-bit number x. n>0.
-static uintL bit_reverse (uintL n, uintL x)
+static uintC bit_reverse (uintL n, uintC x)
 {
-       var uintL y = 0;
+       var uintC y = 0;
        do {
                y <<= 1;
                y |= (x & 1);
@@ -397,7 +397,7 @@ static uintL bit_reverse (uintL n, uintL x)
 #endif
 
 // Compute a complex convolution using FFT: z[0..N-1] := x[0..N-1] * y[0..N-1].
-static void fftc_convolution (const uintL n, const uintL N, // N = 2^n
+static void fftc_convolution (const uintL n, const uintC N, // N = 2^n
                               fftc_complex * x, // N numbers
                               fftc_complex * y, // N numbers
                               fftc_complex * z  // N numbers result
@@ -409,7 +409,7 @@ static void fftc_convolution (const uintL n, const uintL N, // N = 2^n
        #else
        var fftc_complex* const w = cl_alloc_array(fftc_complex,(N>>1)+1);
        #endif
-       var uintL i;
+       var uintC i;
        // Initialize w[i] to w^i, w a primitive N-th root of unity.
        w[0] = fftc_roots_of_1[0];
        #if (FFTC_BACKWARD == RECIPROOT) || defined(DEBUG_FFTC)
@@ -478,10 +478,10 @@ static void fftc_convolution (const uintL n, const uintL N, // N = 2^n
        {
                var sintL l;
                /* l = n-1 */ {
-                       var const uintL tmax = N>>1; // tmax = 2^(n-1)
-                       for (var uintL t = 0; t < tmax; t++) {
-                               var uintL i1 = t;
-                               var uintL i2 = i1 + tmax;
+                       var const uintC tmax = N>>1; // tmax = 2^(n-1)
+                       for (var uintC t = 0; t < tmax; t++) {
+                               var uintC i1 = t;
+                               var uintC i2 = i1 + tmax;
                                // Butterfly: replace (x(i1),x(i2)) by
                                // (x(i1) + x(i2), x(i1) - x(i2)).
                                var fftc_complex tmp;
@@ -491,13 +491,13 @@ static void fftc_convolution (const uintL n, const uintL N, // N = 2^n
                        }
                }
                for (l = n-2; l>=0; l--) {
-                       var const uintL smax = (uintL)1 << (n-1-l);
-                       var const uintL tmax = (uintL)1 << l;
-                       for (var uintL s = 0; s < smax; s++) {
-                               var uintL exp = bit_reverse(n-1-l,s) << l;
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                       var const uintC smax = (uintC)1 << (n-1-l);
+                       var const uintC tmax = (uintC)1 << l;
+                       for (var uintC s = 0; s < smax; s++) {
+                               var uintC exp = bit_reverse(n-1-l,s) << l;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Butterfly: replace (x(i1),x(i2)) by
                                        // (x(i1) + w^exp*x(i2), x(i1) - w^exp*x(i2)).
                                        var fftc_complex tmp;
@@ -512,10 +512,10 @@ static void fftc_convolution (const uintL n, const uintL N, // N = 2^n
        if (!squaring) {
                var sintL l;
                /* l = n-1 */ {
-                       var uintL const tmax = N>>1; // tmax = 2^(n-1)
-                       for (var uintL t = 0; t < tmax; t++) {
-                               var uintL i1 = t;
-                               var uintL i2 = i1 + tmax;
+                       var uintC const tmax = N>>1; // tmax = 2^(n-1)
+                       for (var uintC t = 0; t < tmax; t++) {
+                               var uintC i1 = t;
+                               var uintC i2 = i1 + tmax;
                                // Butterfly: replace (y(i1),y(i2)) by
                                // (y(i1) + y(i2), y(i1) - y(i2)).
                                var fftc_complex tmp;
@@ -525,13 +525,13 @@ static void fftc_convolution (const uintL n, const uintL N, // N = 2^n
                        }
                }
                for (l = n-2; l>=0; l--) {
-                       var const uintL smax = (uintL)1 << (n-1-l);
-                       var const uintL tmax = (uintL)1 << l;
-                       for (var uintL s = 0; s < smax; s++) {
-                               var uintL exp = bit_reverse(n-1-l,s) << l;
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                       var const uintC smax = (uintC)1 << (n-1-l);
+                       var const uintC tmax = (uintC)1 << l;
+                       for (var uintC s = 0; s < smax; s++) {
+                               var uintC exp = bit_reverse(n-1-l,s) << l;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Butterfly: replace (y(i1),y(i2)) by
                                        // (y(i1) + w^exp*y(i2), y(i1) - w^exp*y(i2)).
                                        var fftc_complex tmp;
@@ -549,18 +549,18 @@ static void fftc_convolution (const uintL n, const uintL N, // N = 2^n
        {
                var uintL l;
                for (l = 0; l < n-1; l++) {
-                       var const uintL smax = (uintL)1 << (n-1-l);
-                       var const uintL tmax = (uintL)1 << l;
+                       var const uintC smax = (uintC)1 << (n-1-l);
+                       var const uintC tmax = (uintC)1 << l;
                        #if FFTC_BACKWARD != CLEVER
-                       for (var uintL s = 0; s < smax; s++) {
-                               var uintL exp = bit_reverse(n-1-l,s) << l;
+                       for (var uintC s = 0; s < smax; s++) {
+                               var uintC exp = bit_reverse(n-1-l,s) << l;
                                #if FFTC_BACKWARD == RECIPROOT
                                if (exp > 0)
                                        exp = N - exp; // negate exp (use w^-1 instead of w)
                                #endif
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Inverse Butterfly: replace (z(i1),z(i2)) by
                                        // ((z(i1)+z(i2))/2, (z(i1)-z(i2))/(2*w^exp)).
                                        // Do the division by 2 later.
@@ -574,9 +574,9 @@ static void fftc_convolution (const uintL n, const uintL N, // N = 2^n
                        }
                        #else // FFTC_BACKWARD == CLEVER: clever handling of negative exponents
                        /* s = 0, exp = 0 */ {
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = t;
-                                       var uintL i2 = i1 + tmax;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = t;
+                                       var uintC i2 = i1 + tmax;
                                        // Inverse Butterfly: replace (z(i1),z(i2)) by
                                        // ((z(i1)+z(i2))/2, (z(i1)-z(i2))/(2*w^exp)),
                                        // with exp <-- 0.
@@ -589,12 +589,12 @@ static void fftc_convolution (const uintL n, const uintL N, // N = 2^n
                                        z[i2] = diff;
                                }
                        }
-                       for (var uintL s = 1; s < smax; s++) {
-                               var uintL exp = bit_reverse(n-1-l,s) << l;
+                       for (var uintC s = 1; s < smax; s++) {
+                               var uintC exp = bit_reverse(n-1-l,s) << l;
                                exp = (N>>1) - exp; // negate exp (use w^-1 instead of w)
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Inverse Butterfly: replace (z(i1),z(i2)) by
                                        // ((z(i1)+z(i2))/2, (z(i1)-z(i2))/(2*w^exp)),
                                        // with exp <-- (N/2 - exp).
@@ -611,10 +611,10 @@ static void fftc_convolution (const uintL n, const uintL N, // N = 2^n
                }
                /* l = n-1 */ {
                        var const fftc_real pow2 = (fftc_real)1 / (fftc_real)N;
-                       var const uintL tmax = N>>1; // tmax = 2^(n-1)
-                       for (var uintL t = 0; t < tmax; t++) {
-                               var uintL i1 = t;
-                               var uintL i2 = i1 + tmax;
+                       var const uintC tmax = N>>1; // tmax = 2^(n-1)
+                       for (var uintC t = 0; t < tmax; t++) {
+                               var uintC i1 = t;
+                               var uintC i2 = i1 + tmax;
                                // Inverse Butterfly: replace (z(i1),z(i2)) by
                                // ((z(i1)+z(i2))/2, (z(i1)-z(i2))/2).
                                // Do all the divisions by 2 now.
@@ -656,10 +656,10 @@ static int max_l_table[32+1] =
 
 // Split len uintD's below sourceptr into chunks of l bits, thus filling
 // N complex numbers at x.
-static void fill_factor (uintL N, fftc_complex* x, uintL l,
-                         const uintD* sourceptr, uintL len)
+static void fill_factor (uintC N, fftc_complex* x, uintL l,
+                         const uintD* sourceptr, uintC len)
 {
-       var uintL i;
+       var uintC i;
        if (max_l(2) > intDsize && l > intDsize) {
                // l > intDsize
                if (max_l(2) > 64 && l > 64) {
@@ -784,11 +784,11 @@ static inline fftc_real fftc_ffloor (fftc_real x)
 // The z[i] are known to be approximately integers >= 0, < N*2^(2*l).
 // Assumes room for floor(N*l/intDsize)+(1+ceiling((n+2*l)/intDsize)) uintD's
 // below destptr. Fills len digits and returns (destptr lspop len).
-static uintD* unfill_product (uintL n, uintL N, // N = 2^n
+static uintD* unfill_product (uintL n, uintC N, // N = 2^n
                               const fftc_complex * z, uintL l,
                               uintD* destptr)
 {
-       var uintL i;
+       var uintC i;
        if (n + 2*l <= intDsize) {
                // 2-digit carry is sufficient, l < intDsize
                var uintD carry0 = 0;
@@ -934,11 +934,11 @@ static inline void mulu_fftcomplex_nocheck (const uintD* sourceptr1, uintC len1,
        // is  2*len1*intDsize/l_max - 1 <= 2^k.
        {
                var const int l = max_l(2);
-               var uintL lhs = 2*ceiling((uintL)len1*intDsize,l) - 1; // >=1
+               var uintC lhs = 2*ceiling(len1*intDsize,l) - 1; // >=1
                if (lhs < 3)
                        k = 2;
                else
-                       integerlength32(lhs-1, k=); // k>=2
+                       integerlengthC(lhs-1, k=); // k>=2
        }
        // Try whether this k is ok or whether we have to increase k.
        for ( ; ; k++) {
@@ -947,22 +947,22 @@ static inline void mulu_fftcomplex_nocheck (const uintD* sourceptr1, uintC len1,
                        fprint(std::cerr, "FFT problem: numbers too big, floating point precision not sufficient\n");
                        cl_abort();
                }
-               if (2*ceiling((uintL)len1*intDsize,max_l_table[k])-1 <= ((uintL)1 << k))
+               if (2*ceiling(len1*intDsize,max_l_table[k])-1 <= ((uintC)1 << k))
                        break;
        }
        // We could try to reduce l, keeping the same k. But why should we?
        // Calculate the number of pieces in which source2 will have to be
        // split. Each of the pieces must satisfy
        // ceiling(len1*intDsize/l) + ceiling(len2*intDsize/l) - 1 <= 2^k,
-       var uintL len2p;
+       var uintC len2p;
        // Try once with k, once with k+1. Compare them.
        {
-               var uintL remaining_k = ((uintL)1 << k) + 1 - ceiling((uintL)len1*intDsize,max_l_table[k]);
-               var uintL max_piecelen_k = floor(remaining_k*max_l_table[k],intDsize);
-               var uintL numpieces_k = ceiling(len2,max_piecelen_k);
-               var uintL remaining_k1 = ((uintL)1 << (k+1)) + 1 - ceiling((uintL)len1*intDsize,max_l_table[k+1]);
-               var uintL max_piecelen_k1 = floor(remaining_k1*max_l_table[k+1],intDsize);
-               var uintL numpieces_k1 = ceiling(len2,max_piecelen_k1);
+               var uintC remaining_k = ((uintC)1 << k) + 1 - ceiling(len1*intDsize,max_l_table[k]);
+               var uintC max_piecelen_k = floor(remaining_k*max_l_table[k],intDsize);
+               var uintC numpieces_k = ceiling(len2,max_piecelen_k);
+               var uintC remaining_k1 = ((uintC)1 << (k+1)) + 1 - ceiling(len1*intDsize,max_l_table[k+1]);
+               var uintC max_piecelen_k1 = floor(remaining_k1*max_l_table[k+1],intDsize);
+               var uintC numpieces_k1 = ceiling(len2,max_piecelen_k1);
                if (numpieces_k <= 2*numpieces_k1) {
                        // keep k
                        len2p = max_piecelen_k;
@@ -974,7 +974,7 @@ static inline void mulu_fftcomplex_nocheck (const uintD* sourceptr1, uintC len1,
        }
        var const uintL l = max_l_table[k];
        var const uintL n = k;
-       var const uintL N = (uintL)1 << n;
+       var const uintC N = (uintC)1 << n;
        CL_ALLOCA_STACK;
        var fftc_complex* const x = cl_alloc_array(fftc_complex,N);
        var fftc_complex* const y = cl_alloc_array(fftc_complex,N);
@@ -984,9 +984,9 @@ static inline void mulu_fftcomplex_nocheck (const uintD* sourceptr1, uintC len1,
        var fftc_complex* const z = x; // put z in place of x - saves memory
        #endif
        var uintD* const tmpprod1 = cl_alloc_array(uintD,len1+1);
-       var uintL tmpprod_len = floor(l<<n,intDsize)+6;
+       var uintC tmpprod_len = floor(l<<n,intDsize)+6;
        var uintD* const tmpprod = cl_alloc_array(uintD,tmpprod_len);
-       var uintL destlen = len1+len2;
+       var uintC destlen = len1+len2;
        clear_loop_lsp(destptr,destlen);
        do {
                if (len2p > len2)
@@ -1017,7 +1017,7 @@ static inline void mulu_fftcomplex_nocheck (const uintD* sourceptr1, uintC len1,
                                var fftc_real re_hi_limit = (fftc_real)N * fftc_pow2_table[l] * fftc_pow2_table[l] + (fftc_real)0.5;
                                var fftc_real im_lo_limit = (fftc_real)(-0.5);
                                var fftc_real im_hi_limit = (fftc_real)0.5;
-                               for (var uintL i = 0; i < N; i++) {
+                               for (var uintC i = 0; i < N; i++) {
                                        if (!(z[i].im > im_lo_limit
                                              && z[i].im < im_hi_limit))
                                                cl_abort();
@@ -1029,7 +1029,7 @@ static inline void mulu_fftcomplex_nocheck (const uintD* sourceptr1, uintC len1,
                        #endif
                        var uintD* tmpLSDptr = arrayLSDptr(tmpprod,tmpprod_len);
                        var uintD* tmpMSDptr = unfill_product(n,N,z,l,tmpLSDptr);
-                       var uintL tmplen =
+                       var uintC tmplen =
                          #if CL_DS_BIG_ENDIAN_P
                            tmpLSDptr - tmpMSDptr;
                          #else
index f63ea29a9ea6d4aa16339a1b8f637f6998eefcc4..ed3019d17c8aac994df0dc2af3af4cbca840a28d 100644 (file)
@@ -460,10 +460,10 @@ static inline void mul (const fftcs_complex& a, const fftcs_complex& b, fftcs_co
        r.im = r_im;
 }
 
-static uintL shuffle (uintL n, uintL x)
+static uintC shuffle (uintL n, uintC x)
 {
-       var uintL y = 0;
-       var sintL v = 1;
+       var uintC y = 0;
+       var sintC v = 1;
        // Invariant: y + v*shuffle(n,x).
        do {
                if (x & 1)
@@ -479,16 +479,16 @@ static uintL shuffle (uintL n, uintL x)
 }
 
 #if 0 // unused
-static uintL invshuffle (uintL n, uintL x)
+static uintC invshuffle (uintL n, uintC x)
 {
-       var uintL y = 0;
-       var uintL v = 1;
+       var uintC y = 0;
+       var uintC v = 1;
        // Invariant: y + v*invshuffle(n,x).
        do {
-               if (x == ((uintL)1 << (n-1)))
+               if (x == ((uintC)1 << (n-1)))
                        return y + v;
-               else if (x > ((uintL)1 << (n-1))) {
-                       x = ((uintL)1 << n) - x;
+               else if (x > ((uintC)1 << (n-1))) {
+                       x = ((uintC)1 << n) - x;
                        y = y+v;
                }
                v <<= 1;
@@ -498,7 +498,7 @@ static uintL invshuffle (uintL n, uintL x)
 #endif
 
 // Compute a real convolution using FFT: z[0..N-1] := x[0..N-1] * y[0..N-1].
-static void fftcs_convolution (const uintL n, const uintL N, // N = 2^n
+static void fftcs_convolution (const uintL n, const uintC N, // N = 2^n
                                fftcs_real * x, // N numbers
                                fftcs_real * y, // N numbers
                                fftcs_real * z  // N numbers result
@@ -506,7 +506,7 @@ static void fftcs_convolution (const uintL n, const uintL N, // N = 2^n
 {
        CL_ALLOCA_STACK;
        var fftcs_complex* const w = cl_alloc_array(fftcs_complex,N>>2);
-       var uintL i;
+       var uintC i;
        // Initialize w[i] to w^i, w a primitive N-th root of unity.
        w[0] = fftcs_roots_of_1[0];
        {
@@ -524,10 +524,10 @@ static void fftcs_convolution (const uintL n, const uintL N, // N = 2^n
                var uintL l;
                for (l = n-1; l > 0; l--) {
                        /* s = 0 */ {
-                               var const uintL tmax = (uintL)1 << l;
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = t;
-                                       var uintL i2 = i1 + tmax;
+                               var const uintC tmax = (uintC)1 << l;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = t;
+                                       var uintC i2 = i1 + tmax;
                                        // replace (x[i1],x[i2]) by
                                        // (x[i1] + x[i2], x[i1] - x[i2])
                                        var fftcs_real tmp;
@@ -536,15 +536,15 @@ static void fftcs_convolution (const uintL n, const uintL N, // N = 2^n
                                        x[i1] = x[i1] + tmp;
                                }
                        }
-                       var const uintL smax = (uintL)1 << (n-1-l);
-                       var const uintL tmax = (uintL)1 << (l-1);
-                       for (var uintL s = 1; s < smax; s++) {
-                               var uintL exp = shuffle(n-1-l,s) << (l-1);
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
-                                       var uintL i3 = i2 + tmax;
-                                       var uintL i4 = i3 + tmax;
+                       var const uintC smax = (uintC)1 << (n-1-l);
+                       var const uintC tmax = (uintC)1 << (l-1);
+                       for (var uintC s = 1; s < smax; s++) {
+                               var uintC exp = shuffle(n-1-l,s) << (l-1);
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
+                                       var uintC i3 = i2 + tmax;
+                                       var uintC i4 = i3 + tmax;
                                        // replace (x[i1],x[i2],x[i3],x[i4]) by
                                        // (x[i1] + x[i2]*Re(w^exp) - x[i4]*Im(w^exp),
                                        //  x[i3] + x[i4]*Re(w^exp) + x[i2]*Im(w^exp),
@@ -578,10 +578,10 @@ static void fftcs_convolution (const uintL n, const uintL N, // N = 2^n
                var uintL l;
                for (l = n-1; l > 0; l--) {
                        /* s = 0 */ {
-                               var const uintL tmax = (uintL)1 << l;
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = t;
-                                       var uintL i2 = i1 + tmax;
+                               var const uintC tmax = (uintC)1 << l;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = t;
+                                       var uintC i2 = i1 + tmax;
                                        // replace (y[i1],y[i2]) by
                                        // (y[i1] + y[i2], y[i1] - y[i2])
                                        var fftcs_real tmp;
@@ -590,15 +590,15 @@ static void fftcs_convolution (const uintL n, const uintL N, // N = 2^n
                                        y[i1] = y[i1] + tmp;
                                }
                        }
-                       var const uintL smax = (uintL)1 << (n-1-l);
-                       var const uintL tmax = (uintL)1 << (l-1);
-                       for (var uintL s = 1; s < smax; s++) {
-                               var uintL exp = shuffle(n-1-l,s) << (l-1);
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
-                                       var uintL i3 = i2 + tmax;
-                                       var uintL i4 = i3 + tmax;
+                       var const uintC smax = (uintC)1 << (n-1-l);
+                       var const uintC tmax = (uintC)1 << (l-1);
+                       for (var uintC s = 1; s < smax; s++) {
+                               var uintC exp = shuffle(n-1-l,s) << (l-1);
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
+                                       var uintC i3 = i2 + tmax;
+                                       var uintC i4 = i3 + tmax;
                                        // replace (y[i1],y[i2],y[i3],y[i4]) by
                                        // (y[i1] + y[i2]*Re(w^exp) - y[i4]*Im(w^exp),
                                        //  y[i3] + y[i4]*Re(w^exp) + y[i2]*Im(w^exp),
@@ -649,10 +649,10 @@ static void fftcs_convolution (const uintL n, const uintL N, // N = 2^n
                }
                for (l = 1; l < n; l++) {
                        /* s = 0 */ {
-                               var const uintL tmax = (uintL)1 << l;
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = t;
-                                       var uintL i2 = i1 + tmax;
+                               var const uintC tmax = (uintC)1 << l;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = t;
+                                       var uintC i2 = i1 + tmax;
                                        // replace (z[i1],z[i2]) by
                                        // ((z[i1]+z[i2])/2, (z[i1]-z[i2])/2)
                                        // Do the division by 2 later.
@@ -662,15 +662,15 @@ static void fftcs_convolution (const uintL n, const uintL N, // N = 2^n
                                        z[i1] = z[i1] + tmp;
                                }
                        }
-                       var const uintL smax = (uintL)1 << (n-1-l);
-                       var const uintL tmax = (uintL)1 << (l-1);
-                       for (var uintL s = 1; s < smax; s++) {
-                               var uintL exp = shuffle(n-1-l,s) << (l-1);
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
-                                       var uintL i3 = i2 + tmax;
-                                       var uintL i4 = i3 + tmax;
+                       var const uintC smax = (uintC)1 << (n-1-l);
+                       var const uintC tmax = (uintC)1 << (l-1);
+                       for (var uintC s = 1; s < smax; s++) {
+                               var uintC exp = shuffle(n-1-l,s) << (l-1);
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
+                                       var uintC i3 = i2 + tmax;
+                                       var uintC i4 = i3 + tmax;
                                        // replace (z[i1],z[i2],z[i3],z[i4]) by
                                        // ((z[i1]+z[i3])/2,
                                        //  (z[i1]-z[i3])/2*Re(w^exp)+(z[i2]+z[i4])/2*Im(w^exp),
@@ -720,10 +720,10 @@ static int max_l_table[32+1] =
 
 // Split len uintD's below sourceptr into chunks of l bits, thus filling
 // N real numbers at x.
-static void fill_factor (uintL N, fftcs_real* x, uintL l,
-                         const uintD* sourceptr, uintL len)
+static void fill_factor (uintC N, fftcs_real* x, uintL l,
+                         const uintD* sourceptr, uintC len)
 {
-       var uintL i;
+       var uintC i;
        if (max_l(2) > intDsize && l > intDsize) {
                // l > intDsize
                if (max_l(2) > 64 && l > 64) {
@@ -840,11 +840,11 @@ static inline fftcs_real fftcs_ffloor (fftcs_real x)
 // The z[i] are known to be approximately integers >= 0, < N*2^(2*l).
 // Assumes room for floor(N*l/intDsize)+(1+ceiling((n+2*l)/intDsize)) uintD's
 // below destptr. Fills len digits and returns (destptr lspop len).
-static uintD* unfill_product (uintL n, uintL N, // N = 2^n
+static uintD* unfill_product (uintL n, uintC N, // N = 2^n
                               const fftcs_real * z, uintL l,
                               uintD* destptr)
 {
-       var uintL i;
+       var uintC i;
        if (n + 2*l <= intDsize) {
                // 2-digit carry is sufficient, l < intDsize
                var uintD carry0 = 0;
@@ -990,11 +990,11 @@ static inline void mulu_fftcs_nocheck (const uintD* sourceptr1, uintC len1,
        // is  2*len1*intDsize/l_max - 1 <= 2^k.
        {
                var const int l = max_l(2);
-               var uintL lhs = 2*ceiling((uintL)len1*intDsize,l) - 1; // >=1
+               var uintC lhs = 2*ceiling(len1*intDsize,l) - 1; // >=1
                if (lhs < 3)
                        k = 2;
                else
-                       integerlength32(lhs-1, k=); // k>=2
+                       integerlengthC(lhs-1, k=); // k>=2
        }
        // Try whether this k is ok or whether we have to increase k.
        for ( ; ; k++) {
@@ -1003,22 +1003,22 @@ static inline void mulu_fftcs_nocheck (const uintD* sourceptr1, uintC len1,
                        fprint(std::cerr, "FFT problem: numbers too big, floating point precision not sufficient\n");
                        cl_abort();
                }
-               if (2*ceiling((uintL)len1*intDsize,max_l_table[k])-1 <= ((uintL)1 << k))
+               if (2*ceiling(len1*intDsize,max_l_table[k])-1 <= ((uintC)1 << k))
                        break;
        }
        // We could try to reduce l, keeping the same k. But why should we?
        // Calculate the number of pieces in which source2 will have to be
        // split. Each of the pieces must satisfy
        // ceiling(len1*intDsize/l) + ceiling(len2*intDsize/l) - 1 <= 2^k,
-       var uintL len2p;
+       var uintC len2p;
        // Try once with k, once with k+1. Compare them.
        {
-               var uintL remaining_k = ((uintL)1 << k) + 1 - ceiling((uintL)len1*intDsize,max_l_table[k]);
-               var uintL max_piecelen_k = floor(remaining_k*max_l_table[k],intDsize);
-               var uintL numpieces_k = ceiling(len2,max_piecelen_k);
-               var uintL remaining_k1 = ((uintL)1 << (k+1)) + 1 - ceiling((uintL)len1*intDsize,max_l_table[k+1]);
-               var uintL max_piecelen_k1 = floor(remaining_k1*max_l_table[k+1],intDsize);
-               var uintL numpieces_k1 = ceiling(len2,max_piecelen_k1);
+               var uintC remaining_k = ((uintC)1 << k) + 1 - ceiling(len1*intDsize,max_l_table[k]);
+               var uintC max_piecelen_k = floor(remaining_k*max_l_table[k],intDsize);
+               var uintC numpieces_k = ceiling(len2,max_piecelen_k);
+               var uintC remaining_k1 = ((uintC)1 << (k+1)) + 1 - ceiling(len1*intDsize,max_l_table[k+1]);
+               var uintC max_piecelen_k1 = floor(remaining_k1*max_l_table[k+1],intDsize);
+               var uintC numpieces_k1 = ceiling(len2,max_piecelen_k1);
                if (numpieces_k <= 2*numpieces_k1) {
                        // keep k
                        len2p = max_piecelen_k;
@@ -1030,7 +1030,7 @@ static inline void mulu_fftcs_nocheck (const uintD* sourceptr1, uintC len1,
        }
        var const uintL l = max_l_table[k];
        var const uintL n = k;
-       var const uintL N = (uintL)1 << n;
+       var const uintC N = (uintC)1 << n;
        CL_ALLOCA_STACK;
        var fftcs_real* const x = cl_alloc_array(fftcs_real,N);
        var fftcs_real* const y = cl_alloc_array(fftcs_real,N);
@@ -1040,9 +1040,9 @@ static inline void mulu_fftcs_nocheck (const uintD* sourceptr1, uintC len1,
        var fftcs_real* const z = x; // put z in place of x - saves memory
        #endif
        var uintD* const tmpprod1 = cl_alloc_array(uintD,len1+1);
-       var uintL tmpprod_len = floor(l<<n,intDsize)+6;
+       var uintC tmpprod_len = floor(l<<n,intDsize)+6;
        var uintD* const tmpprod = cl_alloc_array(uintD,tmpprod_len);
-       var uintL destlen = len1+len2;
+       var uintC destlen = len1+len2;
        clear_loop_lsp(destptr,destlen);
        do {
                if (len2p > len2)
@@ -1071,7 +1071,7 @@ static inline void mulu_fftcs_nocheck (const uintD* sourceptr1, uintC len1,
                        {
                                var fftcs_real re_lo_limit = (fftcs_real)(-0.5);
                                var fftcs_real re_hi_limit = (fftcs_real)N * fftcs_pow2_table[l] * fftcs_pow2_table[l] + (fftcs_real)0.5;
-                               for (var uintL i = 0; i < N; i++)
+                               for (var uintC i = 0; i < N; i++)
                                        if (!(z[i] > re_lo_limit
                                              && z[i] < re_hi_limit))
                                                cl_abort();
@@ -1079,7 +1079,7 @@ static inline void mulu_fftcs_nocheck (const uintD* sourceptr1, uintC len1,
                        #endif
                        var uintD* tmpLSDptr = arrayLSDptr(tmpprod,tmpprod_len);
                        var uintD* tmpMSDptr = unfill_product(n,N,z,l,tmpLSDptr);
-                       var uintL tmplen =
+                       var uintC tmplen =
                          #if CL_DS_BIG_ENDIAN_P
                            tmpLSDptr - tmpMSDptr;
                          #else
index 04714f148cb41e5966791afff7a8575916a5a74d..9b973647a44077dc33c620a6d6cfc1dd56752275 100644 (file)
@@ -57,7 +57,7 @@
 // Operations modulo p = 2^R+1, each chunk represented as chlen words
 // (chlen = floor(R/intDsize)+1).
 
-static inline void assign (const uintL R, const uintL chlen,
+static inline void assign (const uintC R, const uintC chlen,
                            const uintD* a, uintD* r)
 {
        unused R;
@@ -65,7 +65,7 @@ static inline void assign (const uintL R, const uintL chlen,
 }
 
 // r := (a + b) mod p
-static void addm (const uintL R, const uintL chlen,
+static void addm (const uintC R, const uintC chlen,
                   const uintD* a, const uintD* b, uintD* r)
 {
        unused R;
@@ -93,7 +93,7 @@ static void addm (const uintL R, const uintL chlen,
 }
 
 // r := (a - b) mod p
-static void subm (const uintL R, const uintL chlen,
+static void subm (const uintC R, const uintC chlen,
                   const uintD* a, const uintD* b, uintD* r)
 {
        unused R;
@@ -116,7 +116,7 @@ static void subm (const uintL R, const uintL chlen,
 
 // r := (a << s) mod p (0 <= s < R).
 // Assume that a and r don't overlap.
-static void shiftleftm (const uintL R, const uintL chlen,
+static void shiftleftm (const uintC R, const uintC chlen,
                         const uintD* a, uintL s, uintD* r)
 {
        // Write a = 2^(R-s)*b + c, then
@@ -175,7 +175,7 @@ static void shiftleftm (const uintL R, const uintL chlen,
 }
 
 // r := (a * b) mod p
-static void mulm (const uintL R, const uintL chlen,
+static void mulm (const uintC R, const uintC chlen,
                   const uintD* a, const uintD* b, uintD* r)
 {
        unused R;
@@ -230,7 +230,7 @@ static void mulm (const uintL R, const uintL chlen,
 }
 
 // b := (a / 2) mod p
-static void shiftm (const uintL R, const uintL chlen,
+static void shiftm (const uintC R, const uintC chlen,
                     const uintD* a, uintD* b)
 {
        unused R;
@@ -253,9 +253,9 @@ static void shiftm (const uintL R, const uintL chlen,
 #ifndef _BIT_REVERSE
 #define _BIT_REVERSE
 // Reverse an n-bit number x. n>0.
-static uintL bit_reverse (uintL n, uintL x)
+static uintC bit_reverse (uintL n, uintC x)
 {
-       var uintL y = 0;
+       var uintC y = 0;
        do {
                y <<= 1;
                y |= (x & 1);
@@ -265,9 +265,9 @@ static uintL bit_reverse (uintL n, uintL x)
 }
 #endif
 
-static void mulu_fftm (const uintL r, const uintL R, // R = 2^r
-                       const uintL m, const uintL M, // M = 2^m
-                       const uintL k, // K = intDsize*k
+static void mulu_fftm (const uintL r, const uintC R, // R = 2^r
+                       const uintL m, const uintC M, // M = 2^m
+                       const uintC k, // K = intDsize*k
                        const uintD* sourceptr1, uintC len1,
                        const uintD* sourceptr2, uintC len2,
                        uintD* destptr)
@@ -277,7 +277,7 @@ static void mulu_fftm (const uintL r, const uintL R, // R = 2^r
 //      R = 2^r, M = 2^m, M | 2R.
 //      m > 0.
 {
-       var const uintL chlen = floor(R,intDsize)+1; // chunk length (in words)
+       var const uintC chlen = floor(R,intDsize)+1; // chunk length (in words)
        CL_ALLOCA_STACK;
        var uintD* const arrX = cl_alloc_array(uintD,chlen<<m);
        var uintD* const arrY = cl_alloc_array(uintD,chlen<<m);
@@ -296,11 +296,11 @@ static void mulu_fftm (const uintL r, const uintL R, // R = 2^r
        num_stack_alloc(chlen,,sum=);
        num_stack_alloc(chlen,,diff=);
        var bool squaring = ((sourceptr1 == sourceptr2) && (len1 == len2));
-       var uintL i;
+       var uintC i;
        // Initialize factors X(i) and Y(i).
        {
                var const uintD* sptr = sourceptr1;
-               var uintL slen = len1;
+               var uintC slen = len1;
                for (i = 0; i < M; i++) {
                        var uintD* ptr = X(i);
                        if (slen >= k) {
@@ -320,7 +320,7 @@ static void mulu_fftm (const uintL r, const uintL R, // R = 2^r
        }
        if (!squaring) {
                var const uintD* sptr = sourceptr2;
-               var uintL slen = len2;
+               var uintC slen = len2;
                for (i = 0; i < M; i++) {
                        var uintD* ptr = Y(i);
                        if (slen >= k) {
@@ -342,10 +342,10 @@ static void mulu_fftm (const uintL r, const uintL R, // R = 2^r
        {
                var sintL l;
                /* l = m-1 */ {
-                       var const uintL tmax = M>>1; // tmax = 2^(m-1)
-                       for (var uintL t = 0; t < tmax; t++) {
-                               var uintL i1 = t;
-                               var uintL i2 = i1 + tmax;
+                       var const uintC tmax = M>>1; // tmax = 2^(m-1)
+                       for (var uintC t = 0; t < tmax; t++) {
+                               var uintC i1 = t;
+                               var uintC i2 = i1 + tmax;
                                // Butterfly: replace (X(i1),X(i2)) by
                                // (X(i1) + X(i2), X(i1) - X(i2)).
                                assign(R,chlen, X(i2), tmp);
@@ -354,14 +354,14 @@ static void mulu_fftm (const uintL r, const uintL R, // R = 2^r
                        }
                }
                for (l = m-2; l>=0; l--) {
-                       var const uintL smax = (uintL)1 << (m-1-l);
-                       var const uintL tmax = (uintL)1 << l;
-                       for (var uintL s = 0; s < smax; s++) {
+                       var const uintC smax = (uintC)1 << (m-1-l);
+                       var const uintC tmax = (uintC)1 << l;
+                       for (var uintC s = 0; s < smax; s++) {
                                // w^exp = 2^(exp << (r+1-m)).
-                               var uintL exp = bit_reverse(m-1-l,s) << (r-(m-1-l));
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                               var uintC exp = bit_reverse(m-1-l,s) << (r-(m-1-l));
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Butterfly: replace (X(i1),X(i2)) by
                                        // (X(i1) + w^exp*X(i2), X(i1) - w^exp*X(i2)).
                                        shiftleftm(R,chlen, X(i2),exp, tmp);
@@ -375,10 +375,10 @@ static void mulu_fftm (const uintL r, const uintL R, // R = 2^r
        if (!squaring) {
                var sintL l;
                /* l = m-1 */ {
-                       var const uintL tmax = M>>1; // tmax = 2^(m-1)
-                       for (var uintL t = 0; t < tmax; t++) {
-                               var uintL i1 = t;
-                               var uintL i2 = i1 + tmax;
+                       var const uintC tmax = M>>1; // tmax = 2^(m-1)
+                       for (var uintC t = 0; t < tmax; t++) {
+                               var uintC i1 = t;
+                               var uintC i2 = i1 + tmax;
                                // Butterfly: replace (Y(i1),Y(i2)) by
                                // (Y(i1) + Y(i2), Y(i1) - Y(i2)).
                                assign(R,chlen, Y(i2), tmp);
@@ -387,14 +387,14 @@ static void mulu_fftm (const uintL r, const uintL R, // R = 2^r
                        }
                }
                for (l = m-2; l>=0; l--) {
-                       var const uintL smax = (uintL)1 << (m-1-l);
-                       var const uintL tmax = (uintL)1 << l;
-                       for (var uintL s = 0; s < smax; s++) {
+                       var const uintC smax = (uintC)1 << (m-1-l);
+                       var const uintC tmax = (uintC)1 << l;
+                       for (var uintC s = 0; s < smax; s++) {
                                // w^exp = 2^(exp << (r+1-m)).
-                               var uintL exp = bit_reverse(m-1-l,s) << (r-(m-1-l));
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                               var uintC exp = bit_reverse(m-1-l,s) << (r-(m-1-l));
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Butterfly: replace (Y(i1),Y(i2)) by
                                        // (Y(i1) + w^exp*Y(i2), Y(i1) - w^exp*Y(i2)).
                                        shiftleftm(R,chlen, Y(i2),exp, tmp);
@@ -416,12 +416,12 @@ static void mulu_fftm (const uintL r, const uintL R, // R = 2^r
        {
                var uintL l;
                for (l = 0; l < m-1; l++) {
-                       var const uintL smax = (uintL)1 << (m-1-l);
-                       var const uintL tmax = (uintL)1 << l;
+                       var const uintC smax = (uintC)1 << (m-1-l);
+                       var const uintC tmax = (uintC)1 << l;
                        /* s = 0, exp = 0 */ {
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = t;
-                                       var uintL i2 = i1 + tmax;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = t;
+                                       var uintC i2 = i1 + tmax;
                                        // Inverse Butterfly: replace (Z(i1),Z(i2)) by
                                        // ((Z(i1)+Z(i2))/2, (Z(i1)-Z(i2))/(2*w^exp)),
                                        // with exp <-- 0.
@@ -431,13 +431,13 @@ static void mulu_fftm (const uintL r, const uintL R, // R = 2^r
                                        shiftm(R,chlen, diff, Z(i2));
                                }
                        }
-                       for (var uintL s = 1; s < smax; s++) {
+                       for (var uintC s = 1; s < smax; s++) {
                                // w^exp = 2^(exp << (r+1-m)).
-                               var uintL exp = bit_reverse(m-1-l,s) << (r-(m-1-l));
+                               var uintC exp = bit_reverse(m-1-l,s) << (r-(m-1-l));
                                exp = R - exp; // negate exp (use w^-1 instead of w)
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Inverse Butterfly: replace (Z(i1),Z(i2)) by
                                        // ((Z(i1)+Z(i2))/2, (Z(i1)-Z(i2))/(2*w^exp)),
                                        // with exp <-- (M/2 - exp).
@@ -449,10 +449,10 @@ static void mulu_fftm (const uintL r, const uintL R, // R = 2^r
                        }
                }
                /* l = m-1 */ {
-                       var const uintL tmax = M>>1; // tmax = 2^(m-1)
-                       for (var uintL t = 0; t < tmax; t++) {
-                               var uintL i1 = t;
-                               var uintL i2 = i1 + tmax;
+                       var const uintC tmax = M>>1; // tmax = 2^(m-1)
+                       for (var uintC t = 0; t < tmax; t++) {
+                               var uintC i1 = t;
+                               var uintC i2 = i1 + tmax;
                                // Inverse Butterfly: replace (Z(i1),Z(i2)) by
                                // ((Z(i1)+Z(i2))/2, (Z(i1)-Z(i2))/2).
                                addm(R,chlen, Z(i1),Z(i2), sum);
@@ -548,20 +548,20 @@ static void mulu_fftm (const uintL r, const uintL R, // R = 2^r
 
 static bool okfor (uintL r, uintL m, uintC len1, uintC len2)
 {
-       var uintL R = (uintL)1 << r;
-       var uintL M = (uintL)1 << m;
-       var uintL k = floor(R-m,2*intDsize);
+       var uintC R = (uintC)1 << r;
+       var uintC M = (uintC)1 << m;
+       var uintC k = floor(R-m,2*intDsize);
        return (ceiling(len1,k)+ceiling(len2,k) <= M+1);
 }
 
-static uintL numpieces (uintL r, uintL m, uintC len1, uintC len2)
+static uintC numpieces (uintL r, uintL m, uintC len1, uintC len2)
 {
-       var uintL R = (uintL)1 << r;
-       var uintL M = (uintL)1 << m;
-       var uintL k = floor(R-m,2*intDsize);
-       var uintL piecelen2 = (M+1-ceiling(len1,k))*k;
+       var uintC R = (uintC)1 << r;
+       var uintC M = (uintC)1 << m;
+       var uintC k = floor(R-m,2*intDsize);
+       var uintC piecelen2 = (M+1-ceiling(len1,k))*k;
        #ifdef DEBUG_FFTM
-       if ((sintL)piecelen2 <= 0)
+       if ((sintC)piecelen2 <= 0)
                cl_abort();
        #endif
        return ceiling(len2,piecelen2);
@@ -573,16 +573,16 @@ static void mulu_fft_modm (const uintD* sourceptr1, uintC len1,
   // Called only with 6 <= len1 <= len2.
   {
        var uint32 n;
-       integerlength32(len1-1, n=); // 2^(n-1) < len1 <= 2^n
+       integerlengthC(len1-1, n=); // 2^(n-1) < len1 <= 2^n
        var uintL r;
        var uintL m;
        r = ceiling(log2_intDsize+1+n,2);
        if (r < log2_intDsize+2)
                r = log2_intDsize+2;
        retry: {
-               var uintL k = floor(((uintL)1 << r) - (r+1), 2*intDsize);
-               var uintL M = 2*ceiling(len1,k)-1;
-               integerlength32(M, m=);
+               var uintC k = floor(((uintC)1 << r) - (r+1), 2*intDsize);
+               var uintC M = 2*ceiling(len1,k)-1;
+               integerlengthC(M, m=);
                if (m == 0)
                        m = 1;
                if (m > r+1) {
@@ -599,21 +599,21 @@ static void mulu_fft_modm (const uintD* sourceptr1, uintC len1,
                        if (!(sourceptr1 == sourceptr2 && len1 == len2)) // when squaring, keep one piece
                                r--;
        } else {
-               var uintL q1 = numpieces(r,m,len1,len2);
+               var uintC q1 = numpieces(r,m,len1,len2);
                if (m <= r) {
-                       var uintL q2 = numpieces(r,m+1,len1,len2);
+                       var uintC q2 = numpieces(r,m+1,len1,len2);
                        if (2*q2 <= q1)
                                m++;
                } else {
-                       var uintL q2 = numpieces(r+1,m,len1,len2);
+                       var uintC q2 = numpieces(r+1,m,len1,len2);
                        if (3*q2 <= q1)
                                r++;
                }
        }
-       var uintL R = (uintL)1 << r;
-       var uintL M = (uintL)1 << m;
-       var uintL k = floor(R-m,2*intDsize);
-       var uintL piecelen2 = (M+1-ceiling(len1,k))*k;
+       var uintC R = (uintC)1 << r;
+       var uintC M = (uintC)1 << m;
+       var uintC k = floor(R-m,2*intDsize);
+       var uintC piecelen2 = (M+1-ceiling(len1,k))*k;
        if (piecelen2 >= len2) {
                // One piece only.
                mulu_fftm(r,R, m,M, k, sourceptr1,len1, sourceptr2,len2, destptr);
@@ -622,15 +622,15 @@ static void mulu_fft_modm (const uintD* sourceptr1, uintC len1,
        CL_ALLOCA_STACK;
        var uintD* tmpptr;
        num_stack_alloc(len1+piecelen2,,tmpptr=);
-       var uintL destlen = len1+len2;
+       var uintC destlen = len1+len2;
        clear_loop_lsp(destptr,destlen);
        do {
-               var uintL len2p; // length of a piece of source2
+               var uintC len2p; // length of a piece of source2
                len2p = piecelen2;
                if (len2p > len2)
                        len2p = len2;
                // len2p = min(piecelen2,len2).
-               var uintL destlenp = len1 + len2p;
+               var uintC destlenp = len1 + len2p;
                // destlenp = min(len1+piecelen2,destlen).
                // Use tmpptr[-destlenp..-1].
                if (len2p == 1) {
index 5cf41b67e7baff4cff291fda8aacea299b72418f..4743f2fede6d15b4e4d8641c448741e89f8e46bd 100644 (file)
@@ -441,9 +441,9 @@ static inline void shiftp (const fftp_word& a, fftp_word& b)
 #ifndef _BIT_REVERSE
 #define _BIT_REVERSE
 // Reverse an n-bit number x. n>0.
-static uintL bit_reverse (uintL n, uintL x)
+static uintC bit_reverse (uintL n, uintC x)
 {
-       var uintL y = 0;
+       var uintC y = 0;
        do {
                y <<= 1;
                y |= (x & 1);
@@ -454,7 +454,7 @@ static uintL bit_reverse (uintL n, uintL x)
 #endif
 
 // Compute an convolution mod p using FFT: z[0..N-1] := x[0..N-1] * y[0..N-1].
-static void fftp_convolution (const uintL n, const uintL N, // N = 2^n
+static void fftp_convolution (const uintL n, const uintC N, // N = 2^n
                               fftp_word * x, // N words
                               fftp_word * y, // N words
                               fftp_word * z  // N words result
@@ -466,7 +466,7 @@ static void fftp_convolution (const uintL n, const uintL N, // N = 2^n
        #else
        var fftp_word* const w = cl_alloc_array(fftp_word,(N>>1)+1);
        #endif
-       var uintL i;
+       var uintC i;
        // Initialize w[i] to w^i, w a primitive N-th root of unity.
        w[0] = fftp_roots_of_1[0];
        w[1] = fftp_roots_of_1[n];
@@ -494,10 +494,10 @@ static void fftp_convolution (const uintL n, const uintL N, // N = 2^n
        {
                var sintL l;
                /* l = n-1 */ {
-                       var const uintL tmax = N>>1; // tmax = 2^(n-1)
-                       for (var uintL t = 0; t < tmax; t++) {
-                               var uintL i1 = t;
-                               var uintL i2 = i1 + tmax;
+                       var const uintC tmax = N>>1; // tmax = 2^(n-1)
+                       for (var uintC t = 0; t < tmax; t++) {
+                               var uintC i1 = t;
+                               var uintC i2 = i1 + tmax;
                                // Butterfly: replace (x(i1),x(i2)) by
                                // (x(i1) + x(i2), x(i1) - x(i2)).
                                var fftp_word tmp;
@@ -507,13 +507,13 @@ static void fftp_convolution (const uintL n, const uintL N, // N = 2^n
                        }
                }
                for (l = n-2; l>=0; l--) {
-                       var const uintL smax = (uintL)1 << (n-1-l);
-                       var const uintL tmax = (uintL)1 << l;
-                       for (var uintL s = 0; s < smax; s++) {
-                               var uintL exp = bit_reverse(n-1-l,s) << l;
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                       var const uintC smax = (uintC)1 << (n-1-l);
+                       var const uintC tmax = (uintC)1 << l;
+                       for (var uintC s = 0; s < smax; s++) {
+                               var uintC exp = bit_reverse(n-1-l,s) << l;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Butterfly: replace (x(i1),x(i2)) by
                                        // (x(i1) + w^exp*x(i2), x(i1) - w^exp*x(i2)).
                                        var fftp_word tmp;
@@ -528,10 +528,10 @@ static void fftp_convolution (const uintL n, const uintL N, // N = 2^n
        if (!squaring) {
                var sintL l;
                /* l = n-1 */ {
-                       var uintL const tmax = N>>1; // tmax = 2^(n-1)
-                       for (var uintL t = 0; t < tmax; t++) {
-                               var uintL i1 = t;
-                               var uintL i2 = i1 + tmax;
+                       var uintC const tmax = N>>1; // tmax = 2^(n-1)
+                       for (var uintC t = 0; t < tmax; t++) {
+                               var uintC i1 = t;
+                               var uintC i2 = i1 + tmax;
                                // Butterfly: replace (y(i1),y(i2)) by
                                // (y(i1) + y(i2), y(i1) - y(i2)).
                                var fftp_word tmp;
@@ -541,13 +541,13 @@ static void fftp_convolution (const uintL n, const uintL N, // N = 2^n
                        }
                }
                for (l = n-2; l>=0; l--) {
-                       var const uintL smax = (uintL)1 << (n-1-l);
-                       var const uintL tmax = (uintL)1 << l;
-                       for (var uintL s = 0; s < smax; s++) {
-                               var uintL exp = bit_reverse(n-1-l,s) << l;
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                       var const uintC smax = (uintC)1 << (n-1-l);
+                       var const uintC tmax = (uintC)1 << l;
+                       for (var uintC s = 0; s < smax; s++) {
+                               var uintC exp = bit_reverse(n-1-l,s) << l;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Butterfly: replace (y(i1),y(i2)) by
                                        // (y(i1) + w^exp*y(i2), y(i1) - w^exp*y(i2)).
                                        var fftp_word tmp;
@@ -565,18 +565,18 @@ static void fftp_convolution (const uintL n, const uintL N, // N = 2^n
        {
                var uintL l;
                for (l = 0; l < n-1; l++) {
-                       var const uintL smax = (uintL)1 << (n-1-l);
-                       var const uintL tmax = (uintL)1 << l;
+                       var const uintC smax = (uintC)1 << (n-1-l);
+                       var const uintC tmax = (uintC)1 << l;
                        #if FFTP_BACKWARD != CLEVER
-                       for (var uintL s = 0; s < smax; s++) {
-                               var uintL exp = bit_reverse(n-1-l,s) << l;
+                       for (var uintC s = 0; s < smax; s++) {
+                               var uintC exp = bit_reverse(n-1-l,s) << l;
                                #if FFTP_BACKWARD == RECIPROOT
                                if (exp > 0)
                                        exp = N - exp; // negate exp (use w^-1 instead of w)
                                #endif
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Inverse Butterfly: replace (z(i1),z(i2)) by
                                        // ((z(i1)+z(i2))/2, (z(i1)-z(i2))/(2*w^exp)).
                                        var fftp_word sum;
@@ -589,9 +589,9 @@ static void fftp_convolution (const uintL n, const uintL N, // N = 2^n
                        }
                        #else // FFTP_BACKWARD == CLEVER: clever handling of negative exponents
                        /* s = 0, exp = 0 */ {
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = t;
-                                       var uintL i2 = i1 + tmax;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = t;
+                                       var uintC i2 = i1 + tmax;
                                        // Inverse Butterfly: replace (z(i1),z(i2)) by
                                        // ((z(i1)+z(i2))/2, (z(i1)-z(i2))/(2*w^exp)),
                                        // with exp <-- 0.
@@ -603,12 +603,12 @@ static void fftp_convolution (const uintL n, const uintL N, // N = 2^n
                                        shiftp(diff, z[i2]);
                                }
                        }
-                       for (var uintL s = 1; s < smax; s++) {
-                               var uintL exp = bit_reverse(n-1-l,s) << l;
+                       for (var uintC s = 1; s < smax; s++) {
+                               var uintC exp = bit_reverse(n-1-l,s) << l;
                                exp = (N>>1) - exp; // negate exp (use w^-1 instead of w)
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Inverse Butterfly: replace (z(i1),z(i2)) by
                                        // ((z(i1)+z(i2))/2, (z(i1)-z(i2))/(2*w^exp)),
                                        // with exp <-- (N/2 - exp).
@@ -623,10 +623,10 @@ static void fftp_convolution (const uintL n, const uintL N, // N = 2^n
                        #endif
                }
                /* l = n-1 */ {
-                       var const uintL tmax = N>>1; // tmax = 2^(n-1)
-                       for (var uintL t = 0; t < tmax; t++) {
-                               var uintL i1 = t;
-                               var uintL i2 = i1 + tmax;
+                       var const uintC tmax = N>>1; // tmax = 2^(n-1)
+                       for (var uintC t = 0; t < tmax; t++) {
+                               var uintC i1 = t;
+                               var uintC i2 = i1 + tmax;
                                // Inverse Butterfly: replace (z(i1),z(i2)) by
                                // ((z(i1)+z(i2))/2, (z(i1)-z(i2))/2).
                                var fftp_word sum;
@@ -661,8 +661,8 @@ static void mulu_fft_modp (const uintD* sourceptr1, uintC len1,
        // sum(i=0..N-1, x_i T^i), sum(i=0..N-1, y_i T^i)
        // multipliziert, und zwar durch Fourier-Transformation (s.o.).
        var uint32 n;
-       integerlength32(len1-1, n=); // 2^(n-1) < len1 <= 2^n
-       var uintL len = (uintL)1 << n; // kleinste Zweierpotenz >= len1
+       integerlengthC(len1-1, n=); // 2^(n-1) < len1 <= 2^n
+       var uintC len = (uintC)1 << n; // kleinste Zweierpotenz >= len1
        // Wählt man N = len, so hat man ceiling(len2/(len-len1+1)) * FFT(len).
        // Wählt man N = 2*len, so hat man ceiling(len2/(2*len-len1+1)) * FFT(2*len).
        // Wir wählen das billigere von beiden:
@@ -673,7 +673,7 @@ static void mulu_fft_modp (const uintD* sourceptr1, uintC len1,
                n = n+1;
                len = len << 1;
        }
-       var const uintL N = len; // N = 2^n
+       var const uintC N = len; // N = 2^n
        CL_ALLOCA_STACK;
        var fftp_word* const x = cl_alloc_array(fftp_word,N);
        var fftp_word* const y = cl_alloc_array(fftp_word,N);
@@ -684,10 +684,10 @@ static void mulu_fft_modp (const uintD* sourceptr1, uintC len1,
        #endif
        var uintD* const tmpprod = cl_alloc_array(uintD,len1+1);
        var uintP i;
-       var uintL destlen = len1+len2;
+       var uintC destlen = len1+len2;
        clear_loop_lsp(destptr,destlen);
        do {
-               var uintL len2p; // length of a piece of source2
+               var uintC len2p; // length of a piece of source2
                len2p = N - len1 + 1;
                if (len2p > len2)
                        len2p = len2;
@@ -700,7 +700,7 @@ static void mulu_fft_modp (const uintD* sourceptr1, uintC len1,
                                if (inc_loop_lsp(destptr lspop (len1+1),destlen-(len1+1)))
                                        cl_abort();
                } else {
-                       var uintL destlenp = len1 + len2p - 1;
+                       var uintC destlenp = len1 + len2p - 1;
                        // destlenp = min(N,destlen-1).
                        var bool squaring = ((sourceptr1 == sourceptr2) && (len1 == len2p));
                        // Fill factor x.
index 619cc3d95375da160438690aa20192ca2da35238..0af1353df78ffdbf12146bf338ba6f02f390f6da 100644 (file)
@@ -308,9 +308,9 @@ static inline void shiftp3 (const fftp3_word& a, fftp3_word& b)
 #ifndef _BIT_REVERSE
 #define _BIT_REVERSE
 // Reverse an n-bit number x. n>0.
-static uintL bit_reverse (uintL n, uintL x)
+static uintC bit_reverse (uintL n, uintC x)
 {
-       var uintL y = 0;
+       var uintC y = 0;
        do {
                y <<= 1;
                y |= (x & 1);
@@ -321,7 +321,7 @@ static uintL bit_reverse (uintL n, uintL x)
 #endif
 
 // Compute an convolution mod p using FFT: z[0..N-1] := x[0..N-1] * y[0..N-1].
-static void fftp3_convolution (const uintL n, const uintL N, // N = 2^n
+static void fftp3_convolution (const uintL n, const uintC N, // N = 2^n
                                fftp3_word * x, // N words
                                fftp3_word * y, // N words
                                fftp3_word * z  // N words result
@@ -333,7 +333,7 @@ static void fftp3_convolution (const uintL n, const uintL N, // N = 2^n
        #else
        var fftp3_word* const w = cl_alloc_array(fftp3_word,(N>>1)+1);
        #endif
-       var uintL i;
+       var uintC i;
        // Initialize w[i] to w^i, w a primitive N-th root of unity.
        w[0] = fftp3_roots_of_1[0];
        w[1] = fftp3_roots_of_1[n];
@@ -361,10 +361,10 @@ static void fftp3_convolution (const uintL n, const uintL N, // N = 2^n
        {
                var sintL l;
                /* l = n-1 */ {
-                       var const uintL tmax = N>>1; // tmax = 2^(n-1)
-                       for (var uintL t = 0; t < tmax; t++) {
-                               var uintL i1 = t;
-                               var uintL i2 = i1 + tmax;
+                       var const uintC tmax = N>>1; // tmax = 2^(n-1)
+                       for (var uintC t = 0; t < tmax; t++) {
+                               var uintC i1 = t;
+                               var uintC i2 = i1 + tmax;
                                // Butterfly: replace (x(i1),x(i2)) by
                                // (x(i1) + x(i2), x(i1) - x(i2)).
                                var fftp3_word tmp;
@@ -374,13 +374,13 @@ static void fftp3_convolution (const uintL n, const uintL N, // N = 2^n
                        }
                }
                for (l = n-2; l>=0; l--) {
-                       var const uintL smax = (uintL)1 << (n-1-l);
-                       var const uintL tmax = (uintL)1 << l;
-                       for (var uintL s = 0; s < smax; s++) {
-                               var uintL exp = bit_reverse(n-1-l,s) << l;
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                       var const uintC smax = (uintC)1 << (n-1-l);
+                       var const uintC tmax = (uintC)1 << l;
+                       for (var uintC s = 0; s < smax; s++) {
+                               var uintC exp = bit_reverse(n-1-l,s) << l;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Butterfly: replace (x(i1),x(i2)) by
                                        // (x(i1) + w^exp*x(i2), x(i1) - w^exp*x(i2)).
                                        var fftp3_word tmp;
@@ -395,10 +395,10 @@ static void fftp3_convolution (const uintL n, const uintL N, // N = 2^n
        if (!squaring) {
                var sintL l;
                /* l = n-1 */ {
-                       var uintL const tmax = N>>1; // tmax = 2^(n-1)
-                       for (var uintL t = 0; t < tmax; t++) {
-                               var uintL i1 = t;
-                               var uintL i2 = i1 + tmax;
+                       var uintC const tmax = N>>1; // tmax = 2^(n-1)
+                       for (var uintC t = 0; t < tmax; t++) {
+                               var uintC i1 = t;
+                               var uintC i2 = i1 + tmax;
                                // Butterfly: replace (y(i1),y(i2)) by
                                // (y(i1) + y(i2), y(i1) - y(i2)).
                                var fftp3_word tmp;
@@ -408,13 +408,13 @@ static void fftp3_convolution (const uintL n, const uintL N, // N = 2^n
                        }
                }
                for (l = n-2; l>=0; l--) {
-                       var const uintL smax = (uintL)1 << (n-1-l);
-                       var const uintL tmax = (uintL)1 << l;
-                       for (var uintL s = 0; s < smax; s++) {
-                               var uintL exp = bit_reverse(n-1-l,s) << l;
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                       var const uintC smax = (uintC)1 << (n-1-l);
+                       var const uintC tmax = (uintC)1 << l;
+                       for (var uintC s = 0; s < smax; s++) {
+                               var uintC exp = bit_reverse(n-1-l,s) << l;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Butterfly: replace (y(i1),y(i2)) by
                                        // (y(i1) + w^exp*y(i2), y(i1) - w^exp*y(i2)).
                                        var fftp3_word tmp;
@@ -432,18 +432,18 @@ static void fftp3_convolution (const uintL n, const uintL N, // N = 2^n
        {
                var uintL l;
                for (l = 0; l < n-1; l++) {
-                       var const uintL smax = (uintL)1 << (n-1-l);
-                       var const uintL tmax = (uintL)1 << l;
+                       var const uintC smax = (uintC)1 << (n-1-l);
+                       var const uintC tmax = (uintC)1 << l;
                        #if FFTP3_BACKWARD != CLEVER
-                       for (var uintL s = 0; s < smax; s++) {
-                               var uintL exp = bit_reverse(n-1-l,s) << l;
+                       for (var uintC s = 0; s < smax; s++) {
+                               var uintC exp = bit_reverse(n-1-l,s) << l;
                                #if FFTP3_BACKWARD == RECIPROOT
                                if (exp > 0)
                                        exp = N - exp; // negate exp (use w^-1 instead of w)
                                #endif
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Inverse Butterfly: replace (z(i1),z(i2)) by
                                        // ((z(i1)+z(i2))/2, (z(i1)-z(i2))/(2*w^exp)).
                                        var fftp3_word sum;
@@ -456,9 +456,9 @@ static void fftp3_convolution (const uintL n, const uintL N, // N = 2^n
                        }
                        #else // FFTP3_BACKWARD == CLEVER: clever handling of negative exponents
                        /* s = 0, exp = 0 */ {
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = t;
-                                       var uintL i2 = i1 + tmax;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = t;
+                                       var uintC i2 = i1 + tmax;
                                        // Inverse Butterfly: replace (z(i1),z(i2)) by
                                        // ((z(i1)+z(i2))/2, (z(i1)-z(i2))/(2*w^exp)),
                                        // with exp <-- 0.
@@ -470,12 +470,12 @@ static void fftp3_convolution (const uintL n, const uintL N, // N = 2^n
                                        shiftp3(diff, z[i2]);
                                }
                        }
-                       for (var uintL s = 1; s < smax; s++) {
-                               var uintL exp = bit_reverse(n-1-l,s) << l;
+                       for (var uintC s = 1; s < smax; s++) {
+                               var uintC exp = bit_reverse(n-1-l,s) << l;
                                exp = (N>>1) - exp; // negate exp (use w^-1 instead of w)
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Inverse Butterfly: replace (z(i1),z(i2)) by
                                        // ((z(i1)+z(i2))/2, (z(i1)-z(i2))/(2*w^exp)),
                                        // with exp <-- (N/2 - exp).
@@ -490,10 +490,10 @@ static void fftp3_convolution (const uintL n, const uintL N, // N = 2^n
                        #endif
                }
                /* l = n-1 */ {
-                       var const uintL tmax = N>>1; // tmax = 2^(n-1)
-                       for (var uintL t = 0; t < tmax; t++) {
-                               var uintL i1 = t;
-                               var uintL i2 = i1 + tmax;
+                       var const uintC tmax = N>>1; // tmax = 2^(n-1)
+                       for (var uintC t = 0; t < tmax; t++) {
+                               var uintC i1 = t;
+                               var uintC i2 = i1 + tmax;
                                // Inverse Butterfly: replace (z(i1),z(i2)) by
                                // ((z(i1)+z(i2))/2, (z(i1)-z(i2))/2).
                                var fftp3_word sum;
@@ -528,8 +528,8 @@ static void mulu_fft_modp3 (const uintD* sourceptr1, uintC len1,
        // sum(i=0..N-1, x_i T^i), sum(i=0..N-1, y_i T^i)
        // multipliziert, und zwar durch Fourier-Transformation (s.o.).
        var uint32 n;
-       integerlength32(len1-1, n=); // 2^(n-1) < len1 <= 2^n
-       var uintL len = (uintL)1 << n; // kleinste Zweierpotenz >= len1
+       integerlengthC(len1-1, n=); // 2^(n-1) < len1 <= 2^n
+       var uintC len = (uintC)1 << n; // kleinste Zweierpotenz >= len1
        // Wählt man N = len, so hat man ceiling(len2/(len-len1+1)) * FFT(len).
        // Wählt man N = 2*len, so hat man ceiling(len2/(2*len-len1+1)) * FFT(2*len).
        // Wir wählen das billigere von beiden:
@@ -540,7 +540,7 @@ static void mulu_fft_modp3 (const uintD* sourceptr1, uintC len1,
                n = n+1;
                len = len << 1;
        }
-       var const uintL N = len; // N = 2^n
+       var const uintC N = len; // N = 2^n
        CL_ALLOCA_STACK;
        var fftp3_word* const x = cl_alloc_array(fftp3_word,N);
        var fftp3_word* const y = cl_alloc_array(fftp3_word,N);
@@ -551,10 +551,10 @@ static void mulu_fft_modp3 (const uintD* sourceptr1, uintC len1,
        #endif
        var uintD* const tmpprod = cl_alloc_array(uintD,len1+1);
        var uintP i;
-       var uintL destlen = len1+len2;
+       var uintC destlen = len1+len2;
        clear_loop_lsp(destptr,destlen);
        do {
-               var uintL len2p; // length of a piece of source2
+               var uintC len2p; // length of a piece of source2
                len2p = N - len1 + 1;
                if (len2p > len2)
                        len2p = len2;
@@ -567,7 +567,7 @@ static void mulu_fft_modp3 (const uintD* sourceptr1, uintC len1,
                                if (inc_loop_lsp(destptr lspop (len1+1),destlen-(len1+1)))
                                        cl_abort();
                } else {
-                       var uintL destlenp = len1 + len2p - 1;
+                       var uintC destlenp = len1 + len2p - 1;
                        // destlenp = min(N,destlen-1).
                        var bool squaring = ((sourceptr1 == sourceptr2) && (len1 == len2p));
                        // Fill factor x.
index 14a277c6a5ea56cb74943c4b5ceaa236ca1fc86a..801d171b7c9430317d3eb950139aa90a9d4176a1 100644 (file)
@@ -483,9 +483,9 @@ static inline void shiftp3m (const fftp3m_word& a, fftp3m_word& b)
 #ifndef _BIT_REVERSE
 #define _BIT_REVERSE
 // Reverse an n-bit number x. n>0.
-static uintL bit_reverse (uintL n, uintL x)
+static uintC bit_reverse (uintL n, uintC x)
 {
-       var uintL y = 0;
+       var uintC y = 0;
        do {
                y <<= 1;
                y |= (x & 1);
@@ -496,7 +496,7 @@ static uintL bit_reverse (uintL n, uintL x)
 #endif
 
 // Compute an convolution mod p using FFT: z[0..N-1] := x[0..N-1] * y[0..N-1].
-static void fftp3m_convolution (const uintL n, const uintL N, // N = 2^n
+static void fftp3m_convolution (const uintL n, const uintC N, // N = 2^n
                                 fftp3m_word * x, // N words
                                 fftp3m_word * y, // N words
                                 fftp3m_word * z  // N words result
@@ -508,7 +508,7 @@ static void fftp3m_convolution (const uintL n, const uintL N, // N = 2^n
        #else
        var fftp3m_word* const w = cl_alloc_array(fftp3m_word,(N>>1)+1);
        #endif
-       var uintL i;
+       var uintC i;
        // Initialize w[i] to w^i, w a primitive N-th root of unity.
        w[0] = fftp3m_roots_of_1[0];
        w[1] = fftp3m_roots_of_1[n];
@@ -540,10 +540,10 @@ static void fftp3m_convolution (const uintL n, const uintL N, // N = 2^n
        {
                var sintL l;
                /* l = n-1 */ {
-                       var const uintL tmax = N>>1; // tmax = 2^(n-1)
-                       for (var uintL t = 0; t < tmax; t++) {
-                               var uintL i1 = t;
-                               var uintL i2 = i1 + tmax;
+                       var const uintC tmax = N>>1; // tmax = 2^(n-1)
+                       for (var uintC t = 0; t < tmax; t++) {
+                               var uintC i1 = t;
+                               var uintC i2 = i1 + tmax;
                                // Butterfly: replace (x(i1),x(i2)) by
                                // (x(i1) + x(i2), x(i1) - x(i2)).
                                var fftp3m_word tmp;
@@ -553,13 +553,13 @@ static void fftp3m_convolution (const uintL n, const uintL N, // N = 2^n
                        }
                }
                for (l = n-2; l>=0; l--) {
-                       var const uintL smax = (uintL)1 << (n-1-l);
-                       var const uintL tmax = (uintL)1 << l;
-                       for (var uintL s = 0; s < smax; s++) {
-                               var uintL exp = bit_reverse(n-1-l,s) << l;
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                       var const uintC smax = (uintC)1 << (n-1-l);
+                       var const uintC tmax = (uintC)1 << l;
+                       for (var uintC s = 0; s < smax; s++) {
+                               var uintC exp = bit_reverse(n-1-l,s) << l;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Butterfly: replace (x(i1),x(i2)) by
                                        // (x(i1) + w^exp*x(i2), x(i1) - w^exp*x(i2)).
                                        var fftp3m_word tmp;
@@ -574,10 +574,10 @@ static void fftp3m_convolution (const uintL n, const uintL N, // N = 2^n
        if (!squaring) {
                var sintL l;
                /* l = n-1 */ {
-                       var uintL const tmax = N>>1; // tmax = 2^(n-1)
-                       for (var uintL t = 0; t < tmax; t++) {
-                               var uintL i1 = t;
-                               var uintL i2 = i1 + tmax;
+                       var uintC const tmax = N>>1; // tmax = 2^(n-1)
+                       for (var uintC t = 0; t < tmax; t++) {
+                               var uintC i1 = t;
+                               var uintC i2 = i1 + tmax;
                                // Butterfly: replace (y(i1),y(i2)) by
                                // (y(i1) + y(i2), y(i1) - y(i2)).
                                var fftp3m_word tmp;
@@ -587,13 +587,13 @@ static void fftp3m_convolution (const uintL n, const uintL N, // N = 2^n
                        }
                }
                for (l = n-2; l>=0; l--) {
-                       var const uintL smax = (uintL)1 << (n-1-l);
-                       var const uintL tmax = (uintL)1 << l;
-                       for (var uintL s = 0; s < smax; s++) {
-                               var uintL exp = bit_reverse(n-1-l,s) << l;
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                       var const uintC smax = (uintC)1 << (n-1-l);
+                       var const uintC tmax = (uintC)1 << l;
+                       for (var uintC s = 0; s < smax; s++) {
+                               var uintC exp = bit_reverse(n-1-l,s) << l;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Butterfly: replace (y(i1),y(i2)) by
                                        // (y(i1) + w^exp*y(i2), y(i1) - w^exp*y(i2)).
                                        var fftp3m_word tmp;
@@ -611,18 +611,18 @@ static void fftp3m_convolution (const uintL n, const uintL N, // N = 2^n
        {
                var uintL l;
                for (l = 0; l < n-1; l++) {
-                       var const uintL smax = (uintL)1 << (n-1-l);
-                       var const uintL tmax = (uintL)1 << l;
+                       var const uintC smax = (uintC)1 << (n-1-l);
+                       var const uintC tmax = (uintC)1 << l;
                        #if FFTP3M_BACKWARD != CLEVER
-                       for (var uintL s = 0; s < smax; s++) {
-                               var uintL exp = bit_reverse(n-1-l,s) << l;
+                       for (var uintC s = 0; s < smax; s++) {
+                               var uintC exp = bit_reverse(n-1-l,s) << l;
                                #if FFTP3M_BACKWARD == RECIPROOT
                                if (exp > 0)
                                        exp = N - exp; // negate exp (use w^-1 instead of w)
                                #endif
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Inverse Butterfly: replace (z(i1),z(i2)) by
                                        // ((z(i1)+z(i2))/2, (z(i1)-z(i2))/(2*w^exp)).
                                        var fftp3m_word sum;
@@ -635,9 +635,9 @@ static void fftp3m_convolution (const uintL n, const uintL N, // N = 2^n
                        }
                        #else // FFTP3M_BACKWARD == CLEVER: clever handling of negative exponents
                        /* s = 0, exp = 0 */ {
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = t;
-                                       var uintL i2 = i1 + tmax;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = t;
+                                       var uintC i2 = i1 + tmax;
                                        // Inverse Butterfly: replace (z(i1),z(i2)) by
                                        // ((z(i1)+z(i2))/2, (z(i1)-z(i2))/(2*w^exp)),
                                        // with exp <-- 0.
@@ -649,12 +649,12 @@ static void fftp3m_convolution (const uintL n, const uintL N, // N = 2^n
                                        shiftp3m(diff, z[i2]);
                                }
                        }
-                       for (var uintL s = 1; s < smax; s++) {
-                               var uintL exp = bit_reverse(n-1-l,s) << l;
+                       for (var uintC s = 1; s < smax; s++) {
+                               var uintC exp = bit_reverse(n-1-l,s) << l;
                                exp = (N>>1) - exp; // negate exp (use w^-1 instead of w)
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Inverse Butterfly: replace (z(i1),z(i2)) by
                                        // ((z(i1)+z(i2))/2, (z(i1)-z(i2))/(2*w^exp)),
                                        // with exp <-- (N/2 - exp).
@@ -669,10 +669,10 @@ static void fftp3m_convolution (const uintL n, const uintL N, // N = 2^n
                        #endif
                }
                /* l = n-1 */ {
-                       var const uintL tmax = N>>1; // tmax = 2^(n-1)
-                       for (var uintL t = 0; t < tmax; t++) {
-                               var uintL i1 = t;
-                               var uintL i2 = i1 + tmax;
+                       var const uintC tmax = N>>1; // tmax = 2^(n-1)
+                       for (var uintC t = 0; t < tmax; t++) {
+                               var uintC i1 = t;
+                               var uintC i2 = i1 + tmax;
                                // Inverse Butterfly: replace (z(i1),z(i2)) by
                                // ((z(i1)+z(i2))/2, (z(i1)-z(i2))/2).
                                var fftp3m_word sum;
@@ -707,8 +707,8 @@ static void mulu_fft_modp3m (const uintD* sourceptr1, uintC len1,
        // sum(i=0..N-1, x_i T^i), sum(i=0..N-1, y_i T^i)
        // multipliziert, und zwar durch Fourier-Transformation (s.o.).
        var uint32 n;
-       integerlength32(len1-1, n=); // 2^(n-1) < len1 <= 2^n
-       var uintL len = (uintL)1 << n; // kleinste Zweierpotenz >= len1
+       integerlengthC(len1-1, n=); // 2^(n-1) < len1 <= 2^n
+       var uintC len = (uintC)1 << n; // kleinste Zweierpotenz >= len1
        // Wählt man N = len, so hat man ceiling(len2/(len-len1+1)) * FFT(len).
        // Wählt man N = 2*len, so hat man ceiling(len2/(2*len-len1+1)) * FFT(2*len).
        // Wir wählen das billigere von beiden:
@@ -719,7 +719,7 @@ static void mulu_fft_modp3m (const uintD* sourceptr1, uintC len1,
                n = n+1;
                len = len << 1;
        }
-       var const uintL N = len; // N = 2^n
+       var const uintC N = len; // N = 2^n
        CL_ALLOCA_STACK;
        var fftp3m_word* const x = cl_alloc_array(fftp3m_word,N);
        var fftp3m_word* const y = cl_alloc_array(fftp3m_word,N);
@@ -730,10 +730,10 @@ static void mulu_fft_modp3m (const uintD* sourceptr1, uintC len1,
        #endif
        var uintD* const tmpprod = cl_alloc_array(uintD,len1+1);
        var uintP i;
-       var uintL destlen = len1+len2;
+       var uintC destlen = len1+len2;
        clear_loop_lsp(destptr,destlen);
        do {
-               var uintL len2p; // length of a piece of source2
+               var uintC len2p; // length of a piece of source2
                len2p = N - len1 + 1;
                if (len2p > len2)
                        len2p = len2;
@@ -746,7 +746,7 @@ static void mulu_fft_modp3m (const uintD* sourceptr1, uintC len1,
                                if (inc_loop_lsp(destptr lspop (len1+1),destlen-(len1+1)))
                                        cl_abort();
                } else {
-                       var uintL destlenp = len1 + len2p - 1;
+                       var uintC destlenp = len1 + len2p - 1;
                        // destlenp = min(N,destlen-1).
                        var bool squaring = ((sourceptr1 == sourceptr2) && (len1 == len2p));
                        // Fill factor x.
index ee8165773cc0303ee46ad371ab6f299fae59765f..588f10212fbdefed36ce5435bd3bd456879debbe 100644 (file)
@@ -398,10 +398,10 @@ static inline void mul (const fftr_complex& a, const fftr_complex& b, fftr_compl
        r.im = r_im;
 }
 
-static uintL shuffle (uintL n, uintL x)
+static uintC shuffle (uintL n, uintC x)
 {
-       var uintL y = 0;
-       var sintL v = 1;
+       var uintC y = 0;
+       var sintC v = 1;
        // Invariant: y + v*shuffle(n,x).
        do {
                if (x & 1)
@@ -417,16 +417,16 @@ static uintL shuffle (uintL n, uintL x)
 }
 
 #if 0 // unused
-static uintL invshuffle (uintL n, uintL x)
+static uintC invshuffle (uintL n, uintC x)
 {
-       var uintL y = 0;
-       var uintL v = 1;
+       var uintC y = 0;
+       var uintC v = 1;
        // Invariant: y + v*invshuffle(n,x).
        do {
-               if (x == ((uintL)1 << (n-1)))
+               if (x == ((uintC)1 << (n-1)))
                        return y + v;
-               else if (x > ((uintL)1 << (n-1))) {
-                       x = ((uintL)1 << n) - x;
+               else if (x > ((uintC)1 << (n-1))) {
+                       x = ((uintC)1 << n) - x;
                        y = y+v;
                }
                v <<= 1;
@@ -436,7 +436,7 @@ static uintL invshuffle (uintL n, uintL x)
 #endif
 
 // Compute a real convolution using FFT: z[0..N-1] := x[0..N-1] * y[0..N-1].
-static void fftr_convolution (const uintL n, const uintL N, // N = 2^n
+static void fftr_convolution (const uintL n, const uintC N, // N = 2^n
                               fftr_real * x, // N numbers
                               fftr_real * y, // N numbers
                               fftr_real * z  // N numbers result
@@ -444,7 +444,7 @@ static void fftr_convolution (const uintL n, const uintL N, // N = 2^n
 {
        CL_ALLOCA_STACK;
        var fftr_cosinus* const w = cl_alloc_array(fftr_cosinus,N>>2);
-       var uintL i;
+       var uintC i;
        // Initialize w[exp].c to exp(2 pi i exp/N).
        w[0].c = fftr_roots_of_1[0];
        {
@@ -469,10 +469,10 @@ static void fftr_convolution (const uintL n, const uintL N, // N = 2^n
                var uintL l;
                for (l = n-1; l > 0; l--) {
                        /* s = 0 */ {
-                               var const uintL tmax = (uintL)1 << l;
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = t;
-                                       var uintL i2 = i1 + tmax;
+                               var const uintC tmax = (uintC)1 << l;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = t;
+                                       var uintC i2 = i1 + tmax;
                                        // replace (x[i1],x[i2]) by
                                        // (x[i1] + x[i2], x[i1] - x[i2])
                                        var fftr_real tmp;
@@ -481,15 +481,15 @@ static void fftr_convolution (const uintL n, const uintL N, // N = 2^n
                                        x[i1] = x[i1] + tmp;
                                }
                        }
-                       var const uintL smax = (uintL)1 << (n-1-l);
-                       var const uintL tmax = (uintL)1 << (l-1);
-                       for (var uintL s = 1; s < smax; s++) {
-                               var uintL exp = shuffle(n-1-l,s) << (l-1);
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
-                                       var uintL i3 = i2 + tmax;
-                                       var uintL i4 = i3 + tmax;
+                       var const uintC smax = (uintC)1 << (n-1-l);
+                       var const uintC tmax = (uintC)1 << (l-1);
+                       for (var uintC s = 1; s < smax; s++) {
+                               var uintC exp = shuffle(n-1-l,s) << (l-1);
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
+                                       var uintC i3 = i2 + tmax;
+                                       var uintC i4 = i3 + tmax;
                                        // replace (x[i1],x[i2],x[i3],x[i4]) by
                                        // (x[i1]-x[i3] - x[i4]*gam,
                                        //  x[i3]*gam + x[i2]+x[i4]*(gam^2-1),
@@ -523,10 +523,10 @@ static void fftr_convolution (const uintL n, const uintL N, // N = 2^n
                var uintL l;
                for (l = n-1; l > 0; l--) {
                        /* s = 0 */ {
-                               var const uintL tmax = (uintL)1 << l;
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = t;
-                                       var uintL i2 = i1 + tmax;
+                               var const uintC tmax = (uintC)1 << l;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = t;
+                                       var uintC i2 = i1 + tmax;
                                        // replace (y[i1],y[i2]) by
                                        // (y[i1] + y[i2], y[i1] - y[i2])
                                        var fftr_real tmp;
@@ -535,15 +535,15 @@ static void fftr_convolution (const uintL n, const uintL N, // N = 2^n
                                        y[i1] = y[i1] + tmp;
                                }
                        }
-                       var const uintL smax = (uintL)1 << (n-1-l);
-                       var const uintL tmax = (uintL)1 << (l-1);
-                       for (var uintL s = 1; s < smax; s++) {
-                               var uintL exp = shuffle(n-1-l,s) << (l-1);
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
-                                       var uintL i3 = i2 + tmax;
-                                       var uintL i4 = i3 + tmax;
+                       var const uintC smax = (uintC)1 << (n-1-l);
+                       var const uintC tmax = (uintC)1 << (l-1);
+                       for (var uintC s = 1; s < smax; s++) {
+                               var uintC exp = shuffle(n-1-l,s) << (l-1);
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
+                                       var uintC i3 = i2 + tmax;
+                                       var uintC i4 = i3 + tmax;
                                        // replace (y[i1],y[i2],y[i3],y[i4]) by
                                        // (y[i1]-y[i3] - y[i4]*gam,
                                        //  y[i3]*gam + y[i2]+y[i4]*(gam^2-1),
@@ -579,11 +579,11 @@ static void fftr_convolution (const uintL n, const uintL N, // N = 2^n
                // Multiplication mod (z+1).
                z[1] = x[1] * y[1];
                #if 0 // This needs w[1..2^(n-1)-1].
-               var const uintL smax = (uintL)1 << (n-1);
-               for (var uintL s = 1; s < smax; s++) {
+               var const uintC smax = (uintC)1 << (n-1);
+               for (var uintC s = 1; s < smax; s++) {
                        // Multiplication mod (z^2 - 2 cos(2 pi j/2^n) z + 1)
                        // with j = shuffle(n-1,s).
-                       var uintL exp = shuffle(n-1,s);
+                       var uintC exp = shuffle(n-1,s);
                        var fftr_real tmp0 = x[2*s] * y[2*s];
                        var fftr_real tmp1 = x[2*s] * y[2*s+1] + x[2*s+1] * y[2*s];
                        var fftr_real tmp2 = x[2*s+1] * y[2*s+1];
@@ -599,9 +599,9 @@ static void fftr_convolution (const uintL n, const uintL N, // N = 2^n
                        z[2] = tmp0 - tmp2;
                        z[3] = tmp1;
                }
-               var const uintL smax = (uintL)1 << (n-2);
-               for (var uintL s = 1; s < smax; s++) {
-                       var uintL exp = shuffle(n-2,s);
+               var const uintC smax = (uintC)1 << (n-2);
+               for (var uintC s = 1; s < smax; s++) {
+                       var uintC exp = shuffle(n-2,s);
                        // Multiplication mod (z^2 - 2 cos(2 pi j/2^n) z + 1)
                        // with j = shuffle(n-1,2*s) = shuffle(n-2,s).
                        var fftr_real gam = w[exp].gam.d;
@@ -636,10 +636,10 @@ static void fftr_convolution (const uintL n, const uintL N, // N = 2^n
                }
                for (l = 1; l < n; l++) {
                        /* s = 0 */ {
-                               var const uintL tmax = (uintL)1 << l;
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = t;
-                                       var uintL i2 = i1 + tmax;
+                               var const uintC tmax = (uintC)1 << l;
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = t;
+                                       var uintC i2 = i1 + tmax;
                                        // replace (z[i1],z[i2]) by
                                        // ((z[i1]+z[i2])/2, (z[i1]-z[i2])/2)
                                        // Do the division by 2 later.
@@ -649,15 +649,15 @@ static void fftr_convolution (const uintL n, const uintL N, // N = 2^n
                                        z[i1] = z[i1] + tmp;
                                }
                        }
-                       var const uintL smax = (uintL)1 << (n-1-l);
-                       var const uintL tmax = (uintL)1 << (l-1);
-                       for (var uintL s = 1; s < smax; s++) {
-                               var uintL exp = shuffle(n-1-l,s) << (l-1);
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
-                                       var uintL i3 = i2 + tmax;
-                                       var uintL i4 = i3 + tmax;
+                       var const uintC smax = (uintC)1 << (n-1-l);
+                       var const uintC tmax = (uintC)1 << (l-1);
+                       for (var uintC s = 1; s < smax; s++) {
+                               var uintC exp = shuffle(n-1-l,s) << (l-1);
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
+                                       var uintC i3 = i2 + tmax;
+                                       var uintC i4 = i3 + tmax;
                                        // replace (z[i1],z[i2],z[i3],z[i4]) by
                                        // ((z[i1]+z[i3]+(z[i2]-z[i4])/gam)/2,
                                        //  (z[i2]+z[i4]-(z[i3]-z[i1])/gam*(gam^2-1))/2,
@@ -707,10 +707,10 @@ static int max_l_table[32+1] =
 
 // Split len uintD's below sourceptr into chunks of l bits, thus filling
 // N real numbers at x.
-static void fill_factor (uintL N, fftr_real* x, uintL l,
-                         const uintD* sourceptr, uintL len)
+static void fill_factor (uintC N, fftr_real* x, uintL l,
+                         const uintD* sourceptr, uintC len)
 {
-       var uintL i;
+       var uintC i;
        if (max_l(2) > intDsize && l > intDsize) {
                // l > intDsize
                if (max_l(2) > 64 && l > 64) {
@@ -827,11 +827,11 @@ static inline fftr_real fftr_ffloor (fftr_real x)
 // The z[i] are known to be approximately integers >= 0, < N*2^(2*l).
 // Assumes room for floor(N*l/intDsize)+(1+ceiling((n+2*l)/intDsize)) uintD's
 // below destptr. Fills len digits and returns (destptr lspop len).
-static uintD* unfill_product (uintL n, uintL N, // N = 2^n
+static uintD* unfill_product (uintL n, uintC N, // N = 2^n
                               const fftr_real * z, uintL l,
                               uintD* destptr)
 {
-       var uintL i;
+       var uintC i;
        if (n + 2*l <= intDsize) {
                // 2-digit carry is sufficient, l < intDsize
                var uintD carry0 = 0;
@@ -977,11 +977,11 @@ static inline void mulu_fftr_nocheck (const uintD* sourceptr1, uintC len1,
        // is  2*len1*intDsize/l_max - 1 <= 2^k.
        {
                var const int l = max_l(2);
-               var uintL lhs = 2*ceiling((uintL)len1*intDsize,l) - 1; // >=1
+               var uintC lhs = 2*ceiling(len1*intDsize,l) - 1; // >=1
                if (lhs < 3)
                        k = 2;
                else
-                       integerlength32(lhs-1, k=); // k>=2
+                       integerlengthC(lhs-1, k=); // k>=2
        }
        // Try whether this k is ok or whether we have to increase k.
        for ( ; ; k++) {
@@ -990,22 +990,22 @@ static inline void mulu_fftr_nocheck (const uintD* sourceptr1, uintC len1,
                        fprint(std::cerr, "FFT problem: numbers too big, floating point precision not sufficient\n");
                        cl_abort();
                }
-               if (2*ceiling((uintL)len1*intDsize,max_l_table[k])-1 <= ((uintL)1 << k))
+               if (2*ceiling(len1*intDsize,max_l_table[k])-1 <= ((uintC)1 << k))
                        break;
        }
        // We could try to reduce l, keeping the same k. But why should we?
        // Calculate the number of pieces in which source2 will have to be
        // split. Each of the pieces must satisfy
        // ceiling(len1*intDsize/l) + ceiling(len2*intDsize/l) - 1 <= 2^k,
-       var uintL len2p;
+       var uintC len2p;
        // Try once with k, once with k+1. Compare them.
        {
-               var uintL remaining_k = ((uintL)1 << k) + 1 - ceiling((uintL)len1*intDsize,max_l_table[k]);
-               var uintL max_piecelen_k = floor(remaining_k*max_l_table[k],intDsize);
-               var uintL numpieces_k = ceiling(len2,max_piecelen_k);
-               var uintL remaining_k1 = ((uintL)1 << (k+1)) + 1 - ceiling((uintL)len1*intDsize,max_l_table[k+1]);
-               var uintL max_piecelen_k1 = floor(remaining_k1*max_l_table[k+1],intDsize);
-               var uintL numpieces_k1 = ceiling(len2,max_piecelen_k1);
+               var uintC remaining_k = ((uintC)1 << k) + 1 - ceiling(len1*intDsize,max_l_table[k]);
+               var uintC max_piecelen_k = floor(remaining_k*max_l_table[k],intDsize);
+               var uintC numpieces_k = ceiling(len2,max_piecelen_k);
+               var uintC remaining_k1 = ((uintC)1 << (k+1)) + 1 - ceiling(len1*intDsize,max_l_table[k+1]);
+               var uintC max_piecelen_k1 = floor(remaining_k1*max_l_table[k+1],intDsize);
+               var uintC numpieces_k1 = ceiling(len2,max_piecelen_k1);
                if (numpieces_k <= 2*numpieces_k1) {
                        // keep k
                        len2p = max_piecelen_k;
@@ -1017,7 +1017,7 @@ static inline void mulu_fftr_nocheck (const uintD* sourceptr1, uintC len1,
        }
        var const uintL l = max_l_table[k];
        var const uintL n = k;
-       var const uintL N = (uintL)1 << n;
+       var const uintC N = (uintC)1 << n;
        CL_ALLOCA_STACK;
        var fftr_real* const x = cl_alloc_array(fftr_real,N);
        var fftr_real* const y = cl_alloc_array(fftr_real,N);
@@ -1027,9 +1027,9 @@ static inline void mulu_fftr_nocheck (const uintD* sourceptr1, uintC len1,
        var fftr_real* const z = x; // put z in place of x - saves memory
        #endif
        var uintD* const tmpprod1 = cl_alloc_array(uintD,len1+1);
-       var uintL tmpprod_len = floor(l<<n,intDsize)+6;
+       var uintC tmpprod_len = floor(l<<n,intDsize)+6;
        var uintD* const tmpprod = cl_alloc_array(uintD,tmpprod_len);
-       var uintL destlen = len1+len2;
+       var uintC destlen = len1+len2;
        clear_loop_lsp(destptr,destlen);
        do {
                if (len2p > len2)
@@ -1058,7 +1058,7 @@ static inline void mulu_fftr_nocheck (const uintD* sourceptr1, uintC len1,
                        {
                                var fftr_real re_lo_limit = (fftr_real)(-0.5);
                                var fftr_real re_hi_limit = (fftr_real)N * fftr_pow2_table[l] * fftr_pow2_table[l] + (fftr_real)0.5;
-                               for (var uintL i = 0; i < N; i++)
+                               for (var uintC i = 0; i < N; i++)
                                        if (!(z[i] > re_lo_limit
                                              && z[i] < re_hi_limit))
                                                cl_abort();
@@ -1066,7 +1066,7 @@ static inline void mulu_fftr_nocheck (const uintD* sourceptr1, uintC len1,
                        #endif
                        var uintD* tmpLSDptr = arrayLSDptr(tmpprod,tmpprod_len);
                        var uintD* tmpMSDptr = unfill_product(n,N,z,l,tmpLSDptr);
-                       var uintL tmplen =
+                       var uintC tmplen =
                          #if CL_DS_BIG_ENDIAN_P
                            tmpLSDptr - tmpMSDptr;
                          #else
index b838fc2b7827d8e216f2dfae41eaddbd9a7014a0..27704d4e5a92df819f06f185bafee422d7230a57 100644 (file)
@@ -73,7 +73,7 @@
           { var uintD* prod_MSDptr;
             var uintD* prod_LSDptr;
             var uintD* prodhi_LSDptr;
-            num_stack_small_alloc(2*(uintL)len1,prod_MSDptr=,prod_LSDptr=);
+            num_stack_small_alloc(2*len1,prod_MSDptr=,prod_LSDptr=);
             prodhi_LSDptr = prod_LSDptr lspop 2*k_lo;
             // prod_MSDptr/2*len1/prod_LSDptr wird zuerst die beiden
             // Produkte x1*y1 in prod_MSDptr/2*k_hi/prodhi_LSDptr
       var uintD* prod_MSDptr;
       var uintC prod_len = len1+len2;
       var uintD* prod_LSDptr;
-      num_stack_small_alloc((uintL)prod_len,prod_MSDptr=,prod_LSDptr=);
+      num_stack_small_alloc(prod_len,prod_MSDptr=,prod_LSDptr=);
       { var uintC k_hi = floor(len2,2); // Länge der High-Teile: floor(len2/2) >0
         var uintC k_lo = len2 - k_hi; // Länge der Low-Teile: ceiling(len2/2) >0
         // Es gilt k_hi <= k_lo <= len1 <= len2, k_lo + k_hi = len2.
index 33b06a1004c8f5e2d42c3f53023a3311b5b0bc60..f6968e38cf6f8f653fb14671f9f6a6e6368d0e01 100644 (file)
@@ -946,9 +946,9 @@ static inline void shift (const nuss_outword& a, nuss_outword& b)
 #ifndef _BIT_REVERSE
 #define _BIT_REVERSE
 // Reverse an n-bit number x. n>0.
-static uintL bit_reverse (uintL n, uintL x)
+static uintC bit_reverse (uintL n, uintC x)
 {
-       var uintL y = 0;
+       var uintC y = 0;
        do {
                y <<= 1;
                y |= (x & 1);
@@ -966,14 +966,14 @@ static uintL bit_reverse (uintL n, uintL x)
 //   threshold1 = 3:   25.6 sec  16.6 sec
 //   threshold1 = 4:   25.7 sec  17.6 sec
 //   threshold1 = 5:   26.1 sec  18.0 sec
-const uintL cl_nuss_threshold1 = 3;
+const uintC cl_nuss_threshold1 = 3;
 
 // Threshold for recursion base in mulu_nuss_cyclic().
-const uintL cl_nuss_threshold2 = 1;
+const uintC cl_nuss_threshold2 = 1;
 
 // Computes z[k] := sum(i+j==k mod N, x[i]*y[j]*(-1)^((i+j-k)/N))
 // for all k=0..N-1.
-static void mulu_nuss_negacyclic (const uintL n, const uintL N, // N = 2^n
+static void mulu_nuss_negacyclic (const uintL n, const uintC N, // N = 2^n
                                   const nuss_inword * x, // N words
                                   const nuss_inword * y, // N words
                                   nuss_outword * z       // N words result
@@ -1003,9 +1003,9 @@ static void mulu_nuss_negacyclic (const uintL n, const uintL N, // N = 2^n
                }
                // 1 < n <= cl_nuss_threshold1.
                #if 0 // straightforward, but slow
-               var uintL k;
+               var uintC k;
                for (k = 0; k < N; k++) {
-                       var uintL i;
+                       var uintC i;
                        var nuss_outword accu;
                        mul(x[0],y[k], accu);
                        for (i = 1; i <= k; i++) {
@@ -1021,14 +1021,14 @@ static void mulu_nuss_negacyclic (const uintL n, const uintL N, // N = 2^n
                        z[k] = accu;
                }
                #else
-               var const uintL M = (uintL)1 << (n-1); // M = N/2
-               var uintL i, j, k;
+               var const uintC M = (uintC)1 << (n-1); // M = N/2
+               var uintC i, j, k;
                for (k = 0; k < N; k++)
                        zero(z[k]);
                for (i = 0; i < M; i++) {
-                       var uintL iM = i+M;
+                       var uintC iM = i+M;
                        for (j = 0; j < M-i; j++) {
-                               var uintL jM = j+M;
+                               var uintC jM = j+M;
                                // z[i+j]   += x[i] (y[j] + y[j+M]) - (x[i] + x[i+M]) y[j+M]
                                // z[i+j+M] += x[i] (y[j] + y[j+M]) + (x[i+M] - x[i]) y[j]
                                var nuss_inword x_sum;
@@ -1042,7 +1042,7 @@ static void mulu_nuss_negacyclic (const uintL n, const uintL N, // N = 2^n
                                mul(x_sum,y[j], second); add(first,second, temp); add(z[i+j+M],temp, z[i+j+M]);
                        }
                        for (j = M-i; j < M; j++) {
-                               var uintL jM = j+M;
+                               var uintC jM = j+M;
                                // z[i+j]   += x[i] (y[j] + y[j+M]) - (x[i] + x[i+M]) y[j+M]
                                // z[i+j-M] -= x[i] (y[j] + y[j+M]) + (x[i+M] - x[i]) y[j]
                                var nuss_inword x_sum;
@@ -1062,8 +1062,8 @@ static void mulu_nuss_negacyclic (const uintL n, const uintL N, // N = 2^n
        // Recursive FFT.
        var const uintL m = n >> 1; // floor(n/2)
        var const uintL r = n - m;  // ceiling(n/2)
-       var const uintL M = (uintL)1 << m; // M = 2^m
-       var const uintL R = (uintL)1 << r; // R = 2^r
+       var const uintC M = (uintC)1 << m; // M = 2^m
+       var const uintC R = (uintC)1 << r; // R = 2^r
        CL_ALLOCA_STACK;
        var nuss_inword* const auX = cl_alloc_array(nuss_inword,2*N);
        var nuss_inword* const auY = cl_alloc_array(nuss_inword,2*N);
@@ -1075,7 +1075,7 @@ static void mulu_nuss_negacyclic (const uintL n, const uintL N, // N = 2^n
        var nuss_inword* const tmp2 = cl_alloc_array(nuss_inword,R);
        var nuss_outword* const tmpZ = cl_alloc_array(nuss_outword,R);
        var bool squaring = (x == y);
-       var uintL i, j;
+       var uintC i, j;
        // Initialize polynomials X(i) and Y(i).
        for (i = 0; i < M; i++) {
                {
@@ -1097,13 +1097,13 @@ static void mulu_nuss_negacyclic (const uintL n, const uintL N, // N = 2^n
                                X(i+M,j) = X(i,j);
                // Level l = m-1..0:
                for (l = m-1; l>=0; l--) {
-                       var const uintL smax = (uintL)1 << (m-l);
-                       var const uintL tmax = (uintL)1 << l;
-                       for (var uintL s = 0; s < smax; s++) {
-                               var uintL exp = bit_reverse(m-l,s) << (l + r-m);
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                       var const uintC smax = (uintC)1 << (m-l);
+                       var const uintC tmax = (uintC)1 << l;
+                       for (var uintC s = 0; s < smax; s++) {
+                               var uintC exp = bit_reverse(m-l,s) << (l + r-m);
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Butterfly: replace (X(i1),X(i2)) by
                                        // (X(i1) + w^exp*X(i2), X(i1) - w^exp*X(i2)).
                                        for (j = 0; j < exp; j++) {
@@ -1132,13 +1132,13 @@ static void mulu_nuss_negacyclic (const uintL n, const uintL N, // N = 2^n
                                Y(i+M,j) = Y(i,j);
                // Level l = m-1..0:
                for (l = m-1; l>=0; l--) {
-                       var const uintL smax = (uintL)1 << (m-l);
-                       var const uintL tmax = (uintL)1 << l;
-                       for (var uintL s = 0; s < smax; s++) {
-                               var uintL exp = bit_reverse(m-l,s) << (l + r-m);
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                       var const uintC smax = (uintC)1 << (m-l);
+                       var const uintC tmax = (uintC)1 << l;
+                       for (var uintC s = 0; s < smax; s++) {
+                               var uintC exp = bit_reverse(m-l,s) << (l + r-m);
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Butterfly: replace (Y(i1),Y(i2)) by
                                        // (Y(i1) + w^exp*Y(i2), Y(i1) - w^exp*Y(i2)).
                                        for (j = 0; j < exp; j++) {
@@ -1171,13 +1171,13 @@ static void mulu_nuss_negacyclic (const uintL n, const uintL N, // N = 2^n
                var uintL l;
                // Level l = 0..m-1:
                for (l = 0; l < m; l++) {
-                       var const uintL smax = (uintL)1 << (m-l);
-                       var const uintL tmax = (uintL)1 << l;
-                       for (var uintL s = 0; s < smax; s++) {
-                               var uintL exp = bit_reverse(m-l,s) << (l + r-m);
-                               for (var uintL t = 0; t < tmax; t++) {
-                                       var uintL i1 = (s << (l+1)) + t;
-                                       var uintL i2 = i1 + tmax;
+                       var const uintC smax = (uintC)1 << (m-l);
+                       var const uintC tmax = (uintC)1 << l;
+                       for (var uintC s = 0; s < smax; s++) {
+                               var uintC exp = bit_reverse(m-l,s) << (l + r-m);
+                               for (var uintC t = 0; t < tmax; t++) {
+                                       var uintC i1 = (s << (l+1)) + t;
+                                       var uintC i2 = i1 + tmax;
                                        // Inverse Butterfly: replace (Z(i1),Z(i2)) by
                                        // ((Z(i1)+Z(i2))/2, (Z(i1)-Z(i2))/(2*w^exp)).
                                        for (j = 0; j < exp; j++)
@@ -1196,8 +1196,8 @@ static void mulu_nuss_negacyclic (const uintL n, const uintL N, // N = 2^n
                }
                // Level l=m:
                for (i = 0; i < M; i++) {
-                       var uintL i1 = i;
-                       var uintL i2 = i1 + M;
+                       var uintC i1 = i;
+                       var uintC i2 = i1 + M;
                        // Inverse Butterfly: replace (Z(i1),Z(i2)) by
                        // ((Z(i1)+Z(i2))/2, (Z(i1)-Z(i2))/2).
                        for (j = 0; j < R; j++) {
@@ -1223,7 +1223,7 @@ static void mulu_nuss_negacyclic (const uintL n, const uintL N, // N = 2^n
 
 // Computes z[k] := sum(i+j==k mod N, x[i]*y[j])
 // for all k=0..N-1.
-static void mulu_nuss_cyclic (const uintL n, const uintL N, // N = 2^n
+static void mulu_nuss_cyclic (const uintL n, const uintC N, // N = 2^n
                               nuss_inword * x, // N words, modified!
                               nuss_inword * y, // N words, modified!
                               nuss_outword * z // N words result
@@ -1258,9 +1258,9 @@ static void mulu_nuss_cyclic (const uintL n, const uintL N, // N = 2^n
        #if 0 // useless code because cl_nuss_threshold2 == 1
        if (n <= cl_nuss_threshold2) {
                #if 0 // straightforward, but slow
-               var uintL k;
+               var uintC k;
                for (k = 0; k < N; k++) {
-                       var uintL i;
+                       var uintC i;
                        var nuss_outword accu;
                        mul(x[0],y[k], accu);
                        for (i = 1; i <= k; i++) {
@@ -1276,14 +1276,14 @@ static void mulu_nuss_cyclic (const uintL n, const uintL N, // N = 2^n
                        z[k] = accu;
                }
                #else
-               var const uintL M = (uintL)1 << (n-1); // M = N/2
-               var uintL i, j, k;
+               var const uintC M = (uintC)1 << (n-1); // M = N/2
+               var uintC i, j, k;
                for (k = 0; k < N; k++)
                        zero(z[k]);
                for (i = 0; i < M; i++) {
-                       var uintL iM = i+M;
+                       var uintC iM = i+M;
                        for (j = 0; j < M; j++) {
-                               var uintL jM = j+M;
+                               var uintC jM = j+M;
                                // z[i+j]   += ((x[i] + x[i+M]) (y[j] + y[j+M]) + (x[i] - x[i+M]) (y[j] - y[j+M])) / 2
                                // z[i+j+M] += ((x[i] + x[i+M]) (y[j] + y[j+M]) - (x[i] - x[i+M]) (y[j] - y[j+M])) / 2
                                var nuss_inword x_sum;
@@ -1298,7 +1298,7 @@ static void mulu_nuss_cyclic (const uintL n, const uintL N, // N = 2^n
                                mul(x_sum,y_sum, first);
                                mul(x_diff,y_diff, second);
                                add(first,second, temp); add(z[i+j],temp, z[i+j]);
-                               var uintL ijM = (i+j+M) & (N-1);
+                               var uintC ijM = (i+j+M) & (N-1);
                                sub(first,second, temp); add(z[ijM],temp, z[ijM]);
                        }
                }
@@ -1309,8 +1309,8 @@ static void mulu_nuss_cyclic (const uintL n, const uintL N, // N = 2^n
        }
        #endif
        var const uintL m = n-1;
-       var const uintL M = (uintL)1 << m; // M = 2^m = N/2
-       var uintL i;
+       var const uintC M = (uintC)1 << m; // M = 2^m = N/2
+       var uintC i;
        // Chinese remainder theorem: u^N-1 = (u^M-1)*(u^M+1)
        for (i = 0; i < M; i++) {
                // Butterfly: replace (x(i),x(i+M))
@@ -1357,8 +1357,8 @@ static void mulu_nussbaumer (const uintD* sourceptr1, uintC len1,
        // sum(i=0..N-1, x_i T^i), sum(i=0..N-1, y_i T^i)
        // multipliziert, und zwar durch Fourier-Transformation (s.o.).
        var uint32 n;
-       integerlength32(len1-1, n=); // 2^(n-1) < len1 <= 2^n
-       var uintL len = (uintL)1 << n; // kleinste Zweierpotenz >= len1
+       integerlengthC(len1-1, n=); // 2^(n-1) < len1 <= 2^n
+       var uintC len = (uintC)1 << n; // kleinste Zweierpotenz >= len1
        // Wählt man N = len, so hat man ceiling(len2/(len-len1+1)) * FFT(len).
        // Wählt man N = 2*len, so hat man ceiling(len2/(2*len-len1+1)) * FFT(2*len).
        // Wir wählen das billigere von beiden:
@@ -1369,17 +1369,17 @@ static void mulu_nussbaumer (const uintD* sourceptr1, uintC len1,
                n = n+1;
                len = len << 1;
        }
-       var const uintL N = len; // N = 2^n
+       var const uintC N = len; // N = 2^n
        CL_ALLOCA_STACK;
        var nuss_inword* const x = cl_alloc_array(nuss_inword,N);
        var nuss_inword* const y = cl_alloc_array(nuss_inword,N);
        var nuss_outword* const z = cl_alloc_array(nuss_outword,N);
        var uintD* const tmpprod = cl_alloc_array(uintD,len1+1);
        var uintP i;
-       var uintL destlen = len1+len2;
+       var uintC destlen = len1+len2;
        clear_loop_lsp(destptr,destlen);
        do {
-               var uintL len2p; // length of a piece of source2
+               var uintC len2p; // length of a piece of source2
                len2p = N - len1 + 1;
                if (len2p > len2)
                        len2p = len2;
@@ -1392,7 +1392,7 @@ static void mulu_nussbaumer (const uintD* sourceptr1, uintC len1,
                                if (inc_loop_lsp(destptr lspop (len1+1),destlen-(len1+1)))
                                        cl_abort();
                } else {
-                       var uintL destlenp = len1 + len2p - 1;
+                       var uintC destlenp = len1 + len2p - 1;
                        // destlenp = min(N,destlen-1).
                        var bool squaring = ((sourceptr1 == sourceptr2) && (len1 == len2p));
                        // Fill factor x.
index 6bcb8a224562ba01cc77a71bde5f2e237641ae6b..a4ed47a27232f7c86bae97ea3540359ebba82df9 100644 (file)
@@ -137,7 +137,7 @@ namespace cln {
       }
       // Other steps.
       var int k;
-      integerlength32((uint32)b_len-1,k=);
+      integerlengthC(b_len-1,k=);
       // 2^(k-1) < b_len <= 2^k, so we need k steps.
       var uintC n = 1;
       for (; k>0; k--)
index 3554cc35bd4a84896e245d1b73db0a216cffa780..e561c541165f8ad0acb8ec72ecb61673600256f2 100644 (file)
@@ -115,7 +115,7 @@ namespace cln {
        }
        // Other steps.
        var int k;
-       integerlength32((uint32)b_len-1,k=);
+       integerlengthC(b_len-1,k=);
        // 2^(k-1) < b_len <= 2^k, so we need k steps, plus one
        // one more step at the beginning (because step 1 was not complete).
        var uintC n = 0;
index 385118da0ce3065f30ad4db165da1babe0a8db8e..382c391a31bb72b59479844845c2c3eab49cf6ba 100644 (file)
@@ -29,7 +29,7 @@ namespace cln {
 // Newton faster for 3200<N            Newton faster for 2750<N
 // When in doubt, prefer to choose the standard algorithm.
 #if CL_USE_GMP
-  static inline cl_boolean cl_recipsqrt_suitable (uintL n)
+  static inline cl_boolean cl_recipsqrt_suitable (uintC n)
   { return (cl_boolean)(n >= 3200); }
 #else
 // Use the old default values from CLN version <= 1.0.3 as a crude estimate.
@@ -47,7 +47,7 @@ namespace cln {
 //    5000   24.1    10.7
 //   10000   98      23.2
 //   -----> Newton faster for 1570 <= N <= 1790 and for N >= 2100.
-  static inline cl_boolean cl_recipsqrt_suitable (uintL n)
+  static inline cl_boolean cl_recipsqrt_suitable (uintC n)
   { return (cl_boolean)(n >= 2100); }
 #endif
 
@@ -126,7 +126,7 @@ cl_boolean cl_UDS_sqrt (const uintD* a_MSDptr, uintC a_len, const uintD* a_LSDpt
       // A um 2s Bits nach links verschoben kopieren:
       var uintD* new_a_MSDptr;
       { var uintD* new_a_LSDptr;
-        num_stack_alloc(2*(uintL)n,new_a_MSDptr=,new_a_LSDptr=); // 2n Digits Platz belegen
+        num_stack_alloc(2*n,new_a_MSDptr=,new_a_LSDptr=); // 2n Digits Platz belegen
        {var uintL shiftcount = 2*s;
         if (!((a_len & bit(0)) ==0)) // a_len ungerade?
           { s += intDsize/2; lsprefnext(new_a_LSDptr) = 0; } // ja -> ein Nulldigit einschieben
index aebdfcabe32909a8bafbb39a667d3c59757345c6..5ef781f24ad563e9ef9c3c2e0c63d6885b1dddc4 100644 (file)
@@ -20,17 +20,17 @@ void testrandom_UDS (random_state& randomstate, uintD* MSDptr, uintC len)
   // Idea from Torbjörn Granlund, see his "random2.c" file in gmp 2.0.
   var uintD* ptr = MSDptr mspop len;
   DS_clear_loop(MSDptr,len,ptr);
-  var uintL bit_pos = 0;
+  var uintC bit_pos = 0;
   var uint32 ran = 0;
   var uintC ran_bits = 0;
-  while (bit_pos < intDsize*(uintL)len)
+  while (bit_pos < intDsize*len)
     { if (ran_bits < log2_intDsize+1)
         { ran = random32(randomstate); ran_bits = 32; }
       var uintL n_bits = (ran >> 1) % intDsize + 1; // number of bits
       if (ran & 1)
         { // put in a bit string of n_bits bits at position bit_pos.
-          if (bit_pos + n_bits > intDsize*(uintL)len)
-            { n_bits = intDsize*(uintL)len - bit_pos; }
+          if (bit_pos + n_bits > intDsize*len)
+            { n_bits = intDsize*len - bit_pos; }
           if (bit_pos / intDsize == (bit_pos + n_bits - 1) / intDsize)
             { // need to modify one digit
               lspref(ptr,bit_pos/intDsize) |= (((uintD)1 << n_bits) - 1) << (bit_pos%intDsize);
index b741ad0ddd18d517fa0fcc9f775ccefae35833a4..0c363394cb81d31393e7032cdeb85ef127571470 100644 (file)
@@ -219,9 +219,9 @@ not_rational_syntax:
                        ptr_after_prec = skip_digits(ptr,string_limit,10);
                        if (ptr_after_prec == ptr) goto not_float_syntax;
                        var cl_I prec1 = digits_to_I(ptr,ptr_after_prec-ptr,10);
-                       var uintL prec2 = cl_I_to_UL(prec1);
+                       var uintC prec2 = cl_I_to_ulong(prec1);
                        prec = (float_base==10 ? float_format(prec2)
-                                              : (float_format_t)((uintL)((1+prec2)*::log((double)float_base)*1.442695041)+1)
+                                              : (float_format_t)((uintC)((1+prec2)*::log((double)float_base)*1.442695041)+1)
                               );
                } else {
                        switch (exponent_marker) {
@@ -236,14 +236,14 @@ not_rational_syntax:
                                // Count the number of significant digits.
                                ptr = ptr_after_sign;
                                while (ptr < ptr_after_fracpart && (*ptr == '0' || *ptr == '.')) ptr++;
-                               var uintL num_significant_digits =
+                               var uintC num_significant_digits =
                                  (ptr_after_fracpart - ptr) - (ptr_before_fracpart > ptr ? 1 : 0);
-                               var uintL prec2 = (num_significant_digits>=2 ? num_significant_digits-2 : 0);
+                               var uintC prec2 = (num_significant_digits>=2 ? num_significant_digits-2 : 0);
                                var float_format_t precx =
                                  (float_base==10 ? float_format(prec2)
-                                                 : (float_format_t)((uintL)((1+prec2)*::log((double)float_base)*1.442695041)+1)
+                                                 : (float_format_t)((uintC)((1+prec2)*::log((double)float_base)*1.442695041)+1)
                                  );
-                               if ((uintL)precx > (uintL)prec)
+                               if ((uintC)precx > (uintC)prec)
                                        prec = precx;
                        }
                }
index 572c72224b2b9f39169f0def304a89736c311c7d..0ee1461ecdcd6d171287d8bab51396427c9ba9f1 100644 (file)
@@ -109,7 +109,7 @@ const cl_C_R asinh (const cl_R& x, const cl_R& y)
                var cl_F& y = yf;
                if (zerop(y)) // y=0.0 -> arcsin(y) = y als Ergebnis
                        return cl_C_R(0,y);
-               if (float_exponent(y) <= (-(sintL)float_digits(y))>>1)
+               if (float_exponent(y) <= (-(sintC)float_digits(y))>>1)
                        // e <= -d/2 <==> e <= -ceiling(d/2)
                        return cl_C_R(0,y);
                var cl_F temp = 1-square(y);
index 6edf3353e100ae0c0e77345aec0cf8554d3243d3..151a9d25fc269af2b596217977247f4625d69c26 100644 (file)
@@ -155,7 +155,7 @@ const cl_N expt (const cl_N& x, const cl_N& y)
                        if (cl_false) {
                                complex_rational:
                                // x in Q(i)
-                               var uintL k = power2p(n);
+                               var uintC k = power2p(n);
                                if (k) {
                                        // n Zweierpotenz = 2^(k-1). n>1, also k>1
                                        Mutable(cl_N,x);
index 1a48faa53f25cb6347242caed49ff18a87cef07f..9dd7b205c04d24baaf179df40e73e21a1e87731a 100644 (file)
@@ -275,7 +275,7 @@ extern const cl_F cl_F_shortenrelative (const cl_F& x, const cl_F& y);
     { if ((value) <= float_format_sfloat) { SF_statement }             \
       elif ((value) <= float_format_ffloat) { FF_statement }           \
       elif ((value) <= float_format_dfloat) { DF_statement }           \
-      else { var uintL len = ceiling((uintL)(value),intDsize); LF_statement } \
+      else { var uintC len = ceiling((uintC)(value),intDsize); LF_statement } \
     }
 
 }  // namespace cln
index cf94877d0f446f9e22427d1d1d94e7de3f741e36..fc1d0be8930a283f73edcd93693a1c5cca45eb57 100644 (file)
@@ -15,7 +15,7 @@ namespace cln {
 
 const cl_F cl_float (const cl_F& x, float_format_t f)
 {
-       floatformatcase((uintL)f
+       floatformatcase((uintC)f
        ,       return cl_F_to_SF(x);
        ,       return cl_F_to_FF(x);
        ,       return cl_F_to_DF(x);
index 4aab33d90be39ef9c7ada51ddd325a840b6ab75f..1b5b8daefb2551c687dc800b0096d73af720ddb4 100644 (file)
@@ -19,7 +19,7 @@ namespace cln {
 
 const cl_F cl_float (const cl_I& x, float_format_t f)
 {
-       floatformatcase((uintL)f
+       floatformatcase((uintC)f
        ,       return cl_I_to_SF(x);
        ,       return cl_I_to_FF(x);
        ,       return cl_I_to_DF(x);
index f83ba3c60da3a6d5d7fff85c500738e9a9db7093..213db2a84684e3b0643cef76a5b0fa43772cbf27 100644 (file)
@@ -19,7 +19,7 @@ namespace cln {
 
 const cl_F cl_float (const cl_RA& x, float_format_t f)
 {
-       floatformatcase((uintL)f
+       floatformatcase((uintC)f
        ,       return cl_RA_to_SF(x);
        ,       return cl_RA_to_FF(x);
        ,       return cl_RA_to_DF(x);
index 6223450250c8409efa94003d7ba32df82936535b..8cb841e3897795149b4b122bdb428cd5900f23b7 100644 (file)
@@ -22,7 +22,7 @@ double double_approx (const cl_I& x)
       if (eq(x,0)) { return 0.0; }
       var cl_signean sign = -(cl_signean)minusp(x); // Vorzeichen
       var cl_I abs_x = (sign==0 ? x : -x);
-      var uintL exp = integer_length(abs_x); // (integer-length x)
+      var uintC exp = integer_length(abs_x); // (integer-length x)
       // NDS zu |x|>0 bilden:
       var const uintD* MSDptr;
       var uintC len;
index bde025f4500bd9fc601f7f2625ea2214c8a0b054..373702dc73fa8d23e27e798855f7b0243e66d4ed 100644 (file)
@@ -31,8 +31,8 @@ double double_approx (const cl_RA& x)
       var const cl_I& b = denominator(x); // b
       var cl_signean sign = -(cl_signean)minusp(a); // Vorzeichen
       if (!(sign==0)) { a = -a; } // Betrag nehmen, liefert a
-      var sintL lendiff = (sintL)integer_length(a) // (integer-length a)
-                          - (sintL)integer_length(b); // (integer-length b)
+      var sintC lendiff = (sintC)integer_length(a) // (integer-length a)
+                          - (sintC)integer_length(b); // (integer-length b)
       if (lendiff > DF_exp_high-DF_exp_mid) // Exponent >= n-m > Obergrenze ?
         {
           #if (cl_word_size==64)
index a4efd9d6f1ed119963d9bd6cfaa189bb57dce44e..d07225b68e789e8a46944577491f4050710644e4 100644 (file)
@@ -34,7 +34,7 @@ const cl_DF cl_I_to_DF (const cl_I& x)
       if (eq(x,0)) { return cl_DF_0; }
       var cl_signean sign = -(cl_signean)minusp(x); // Vorzeichen
       var cl_I abs_x = (sign==0 ? x : -x);
-      var uintL exp = integer_length(abs_x); // (integer-length x)
+      var uintC exp = integer_length(abs_x); // (integer-length x)
       // NDS zu |x|>0 bilden:
       var const uintD* MSDptr;
       var uintC len;
index 4bba2debeb9d46d93a6d02e3f7496050940abb27..f05bbc5210f4f9179049e114b816e5c7bc83d7f8 100644 (file)
@@ -41,8 +41,8 @@ const cl_DF cl_RA_to_DF (const cl_RA& x)
       var const cl_I& b = denominator(x); // b
       var cl_signean sign = -(cl_signean)minusp(a); // Vorzeichen
       if (!(sign==0)) { a = -a; } // Betrag nehmen, liefert a
-      var sintL lendiff = (sintL)integer_length(a) // (integer-length a)
-                          - (sintL)integer_length(b); // (integer-length b)
+      var sintC lendiff = (sintC)integer_length(a) // (integer-length a)
+                          - (sintC)integer_length(b); // (integer-length b)
       if (lendiff > DF_exp_high-DF_exp_mid) // Exponent >= n-m > Obergrenze ?
         { cl_error_floating_point_overflow(); } // -> Overflow
       if (lendiff < DF_exp_low-DF_exp_mid-2) // Exponent <= n-m+2 < Untergrenze ?
index ac19bcb4bf92a245aa1ef323fcf91e648fa53633..b3c1ef02afbf3e048463fa51003cd0f7f647b299 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace cln {
 
-const cl_DF scale_float (const cl_DF& x, sintL delta)
+const cl_DF scale_float (const cl_DF& x, sintC delta)
 {
   // Methode:
   // x=0.0 -> x als Ergebnis
@@ -33,7 +33,7 @@ const cl_DF scale_float (const cl_DF& x, sintL delta)
 #endif
       if (delta >= 0)
         // delta>=0
-        { var uintL udelta = delta;
+        { var uintC udelta = delta;
           if (udelta <= (uintL)(DF_exp_high-DF_exp_low))
             { exp = exp+udelta;
 #if (cl_word_size==64)
@@ -47,7 +47,7 @@ const cl_DF scale_float (const cl_DF& x, sintL delta)
         }
         else
         // delta<0
-        { var uintL udelta = -delta;
+        { var uintC udelta = -delta;
           if (udelta <= (uintL)(DF_exp_high-DF_exp_low))
             { exp = exp-udelta;
 #if (cl_word_size==64)
index 53670bf988343de7aeabc846c2268f78d346e4c1..97b9fed6b5efabd797a22c44d46b6580774b7884 100644 (file)
@@ -14,7 +14,7 @@
 namespace cln {
 
 MAYBE_INLINE
-uintL float_digits (const cl_DF& x)
+uintC float_digits (const cl_DF& x)
 {
        unused x;
        return DF_mant_len+1; // 53
index 5bafcedd27355cb8e746b13d87696776761436ef..0e6b28964d664e9aec880ad6062b28699b6942e6 100644 (file)
@@ -18,7 +18,7 @@
 namespace cln {
 
 MAYBE_INLINE2
-uintL float_precision (const cl_DF& x)
+uintC float_precision (const cl_DF& x)
 {
        if (zerop(x)) return 0;
        return DF_mant_len+1; // 53
index ae3ff38be5a0cf796215c3f46391b89c0298ebbe..b3f9f626341e72348a1cb2901712b775d6c5feab 100644 (file)
@@ -17,7 +17,7 @@
 
 namespace cln {
 
-const cl_F scale_float (const cl_F& x, sintL delta)
+const cl_F scale_float (const cl_F& x, sintC delta)
 {
        floatcase(x
        ,       return scale_float(x,delta);
index 53d80ec4091507a6df2ad522093a06844197c066..8b0b56e35c976549ffc107b2b201114c3b87ab8b 100644 (file)
@@ -22,7 +22,7 @@ float float_approx (const cl_I& x)
       if (eq(x,0)) { return 0.0; }
       var cl_signean sign = -(cl_signean)minusp(x); // Vorzeichen
       var cl_I abs_x = (sign==0 ? x : -x);
-      var uintL exp = integer_length(abs_x); // (integer-length x)
+      var uintC exp = integer_length(abs_x); // (integer-length x)
       // NDS zu |x|>0 bilden:
       var const uintD* MSDptr;
       var uintC len;
index d9a2ea87166f78edd692f77fc59d362f5eb8deed..74a146d0cb26f34b5463d7d6ae73797197766df2 100644 (file)
@@ -31,8 +31,8 @@ float float_approx (const cl_RA& x)
       var const cl_I& b = denominator(x); // b
       var cl_signean sign = -(cl_signean)minusp(a); // Vorzeichen
       if (!(sign==0)) { a = -a; } // Betrag nehmen, liefert a
-      var sintL lendiff = (sintL)integer_length(a) // (integer-length a)
-                          - (sintL)integer_length(b); // (integer-length b)
+      var sintC lendiff = (sintC)integer_length(a) // (integer-length a)
+                          - (sintC)integer_length(b); // (integer-length b)
       if (lendiff > FF_exp_high-FF_exp_mid) // Exponent >= n-m > Obergrenze ?
         { u.eksplicit = make_FF_word(sign,bit(FF_exp_len)-1,0); // Infinity
           return u.machine_float;
index a459c462840ba8a6b27476401121b20c52fc7547..edf5e456e4c804ab948420119b212addf6ac9052 100644 (file)
@@ -34,7 +34,7 @@ const cl_FF cl_I_to_FF (const cl_I& x)
       if (eq(x,0)) { return cl_FF_0; }
       var cl_signean sign = -(cl_signean)minusp(x); // Vorzeichen
       var cl_I abs_x = (sign==0 ? x : -x);
-      var uintL exp = integer_length(abs_x); // (integer-length x)
+      var uintC exp = integer_length(abs_x); // (integer-length x)
       // NDS zu |x|>0 bilden:
       var const uintD* MSDptr;
       var uintC len;
index 4e276e6f19f9a13c2e38267eff66ffc5389c7059..40332a82ad737387dc2a06caf1d10c10847a6287 100644 (file)
@@ -41,8 +41,8 @@ const cl_FF cl_RA_to_FF (const cl_RA& x)
       var const cl_I& b = denominator(x); // b
       var cl_signean sign = -(cl_signean)minusp(a); // Vorzeichen
       if (!(sign==0)) { a = -a; } // Betrag nehmen, liefert a
-      var sintL lendiff = (sintL)integer_length(a) // (integer-length a)
-                          - (sintL)integer_length(b); // (integer-length b)
+      var sintC lendiff = (sintC)integer_length(a) // (integer-length a)
+                          - (sintC)integer_length(b); // (integer-length b)
       if (lendiff > FF_exp_high-FF_exp_mid) // Exponent >= n-m > Obergrenze ?
         { cl_error_floating_point_overflow(); } // -> Overflow
       if (lendiff < FF_exp_low-FF_exp_mid-2) // Exponent <= n-m+2 < Untergrenze ?
index b6dc24d839626ee267b097b3bd26ca05c0326baa..8cf7b4d8a51b1df0c09bf460a6690c7d6a0dfeb8 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace cln {
 
-const cl_FF scale_float (const cl_FF& x, sintL delta)
+const cl_FF scale_float (const cl_FF& x, sintC delta)
 {
   // Methode:
   // x=0.0 -> x als Ergebnis
@@ -27,7 +27,7 @@ const cl_FF scale_float (const cl_FF& x, sintL delta)
       FF_decode(x, { return x; }, sign=,exp=,mant=);
       if (delta >= 0)
         // delta>=0
-        { var uintL udelta = delta;
+        { var uintC udelta = delta;
           if (udelta <= (uintL)(FF_exp_high-FF_exp_low))
             { exp = exp+udelta;
               return encode_FF(sign,exp,mant);
@@ -37,7 +37,7 @@ const cl_FF scale_float (const cl_FF& x, sintL delta)
         }
         else
         // delta<0
-        { var uintL udelta = -delta;
+        { var uintC udelta = -delta;
           if (udelta <= (uintL)(FF_exp_high-FF_exp_low))
             { exp = exp-udelta;
               return encode_FF(sign,exp,mant);
index cff0855b6a679849bd28a1a64764db890d39c092..4d209efe5350e3e109495b45afb00733ca86f0b7 100644 (file)
@@ -14,7 +14,7 @@
 namespace cln {
 
 MAYBE_INLINE
-uintL float_digits (const cl_FF& x)
+uintC float_digits (const cl_FF& x)
 {
        unused x;
        return FF_mant_len+1; // 24
index 913350555700b3d56c01aaa31d24b984ea3915a1..e60defc44bd13f18ba2c766fa8c9297549e6997d 100644 (file)
@@ -18,7 +18,7 @@
 namespace cln {
 
 MAYBE_INLINE2
-uintL float_precision (const cl_FF& x)
+uintC float_precision (const cl_FF& x)
 {
        if (zerop(x)) return 0;
        return FF_mant_len+1; // 24
index 398510b322bf2fc806ff6991333cbe949c57c9a0..3ed96bffa547aa9d02b51122b6b2e2c309ee7cc1 100644 (file)
@@ -131,9 +131,9 @@ const cl_F read_float (const cl_read_flags& flags, const char * string, const ch
                        ptr_after_prec = skip_digits(ptr,string_limit,10);
                        if (ptr_after_prec == ptr) goto not_float_syntax;
                        var cl_I prec1 = digits_to_I(ptr,ptr_after_prec-ptr,10);
-                       var uintL prec2 = cl_I_to_UL(prec1);
+                       var uintC prec2 = cl_I_to_UL(prec1);
                        prec = (float_base==10 ? float_format(prec2)
-                                              : (float_format_t)((uintL)((1+prec2)*::log((double)float_base)*1.442695041)+1)
+                                              : (float_format_t)((uintC)((1+prec2)*::log((double)float_base)*1.442695041)+1)
                               );
                } else {
                        switch (exponent_marker) {
@@ -148,14 +148,14 @@ const cl_F read_float (const cl_read_flags& flags, const char * string, const ch
                                // Count the number of significant digits.
                                ptr = ptr_after_sign;
                                while (ptr < ptr_after_fracpart && (*ptr == '0' || *ptr == '.')) ptr++;
-                               var uintL num_significant_digits =
+                               var uintC num_significant_digits =
                                  (ptr_after_fracpart - ptr) - (ptr_before_fracpart > ptr ? 1 : 0);
-                               var uintL prec2 = (num_significant_digits>=2 ? num_significant_digits-2 : 0);
+                               var uintC prec2 = (num_significant_digits>=2 ? num_significant_digits-2 : 0);
                                var float_format_t precx =
                                  (float_base==10 ? float_format(prec2)
-                                                 : (float_format_t)((uintL)((1+prec2)*::log((double)float_base)*1.442695041)+1)
+                                                 : (float_format_t)((uintC)((1+prec2)*::log((double)float_base)*1.442695041)+1)
                                  );
-                               if ((uintL)precx > (uintL)prec)
+                               if ((uintC)precx > (uintC)prec)
                                        prec = precx;
                        }
                }
index 613e4fb69eb92efda5a5fbf21ff511e9333df0e3..87d974c5026391845cd9d5d9625f23b5866daced 100644 (file)
@@ -42,7 +42,7 @@ const cl_LF sqrt (const cl_LF& x)
       CL_ALLOCA_STACK;
       var uintD* r_MSDptr;
       var uintD* r_LSDptr;
-      var uintL r_len = 2*(uintL)len+2; // L�ge des Radikanden
+      var uintC r_len = 2*len+2; // Länge des Radikanden
       num_stack_alloc(r_len, r_MSDptr=,r_LSDptr=);
       if ((uexp & bit(0)) == (LF_exp_mid & bit(0)))
         // Exponent gerade
index 4c90e5004f1cf71f20d3b5f54b4052a2b5c80a04..00fcfe6782215a2377a007a8fc679a57ec41b61c 100644 (file)
@@ -57,7 +57,7 @@ const cl_LF LF_LF_plus_LF (const cl_LF& arg1, const cl_LF& arg2)
               swap(uintL, uexp1,uexp2);
             }
         }
-      if (expdiff >= intDsize * (uintL)len + 2) // e1-e2 >= 16n+2 ?
+      if (expdiff >= intDsize * len + 2) // e1-e2 >= 16n+2 ?
         { return x1; } // ja -> x1 als Ergebnis
       // neues Long-Float allozieren:
       var Lfloat y = allocate_lfloat(len,uexp1,TheLfloat(x1)->sign);
@@ -153,7 +153,7 @@ const cl_LF LF_LF_plus_LF (const cl_LF& arg1, const cl_LF& arg2)
            }
            // UDS y_mantMSDptr/len/y_mantLSDptr/rounding_bits normalisieren:
            {var uintD* ptr = y_mantMSDptr;
-            var uintL k = 0;
+            var uintC k = 0;
             var uintC count;
             dotimesC(count,len,
               { if (!(mspref(ptr,0)==0)) goto nonzero_found;
index bce4a5af5510f8b792d2b2dbed5555c588c7fec4..188f089e8783a0ffdaec8cf2d9f02f721f5f88a9 100644 (file)
@@ -33,7 +33,7 @@ const cl_LF cl_LF_I_div (const cl_LF& x, const cl_I& y)
        }
        var cl_signean sign = -(cl_signean)minusp(y); // Vorzeichen von y
        var cl_I abs_y = (sign==0 ? y : -y);
-       var uintL y_exp = integer_length(abs_y);
+       var uintC y_exp = integer_length(abs_y);
        var uintC len = TheLfloat(x)->len;
 #ifndef CL_LF_PEDANTIC
        if (ceiling(y_exp,intDsize) > len)
@@ -48,9 +48,9 @@ const cl_LF cl_LF_I_div (const cl_LF& x, const cl_I& y)
        // y nicht zu einer NUDS normalisieren! (Damit ein Bit Spielraum ist.)
        // Zähler bilden: x * 2^(intDsize*y_len)
        var uintD* z_MSDptr;
-       var uintL z_len;
+       var uintC z_len;
        var uintD* z_LSDptr;
-       z_len = (uintL)len + (uintL)y_len;
+       z_len = len + y_len;
        num_stack_alloc(z_len, z_MSDptr=,z_LSDptr=);
        { var uintD* ptr = copy_loop_msp(arrayMSDptr(TheLfloat(x)->data,len),z_MSDptr,len); // len Digits
          clear_loop_msp(ptr,y_len); // und y_len Null-Digits
index 4fcafe1c72ba871e891f281cffe606a904cab513..927c2682cf54c2e7dc0ede13811f4cde819d2aa4 100644 (file)
@@ -28,7 +28,7 @@ const cl_R cl_LF_I_mul (const cl_LF& x, const cl_I& y)
        if (TheLfloat(x)->expo == 0) { return x; }
        var cl_signean sign = -(cl_signean)minusp(y); // Vorzeichen von y
        var cl_I abs_y = (sign==0 ? y : -y);
-       var uintL y_exp = integer_length(abs_y);
+       var uintC y_exp = integer_length(abs_y);
        var uintC len = TheLfloat(x)->len;
 #ifndef CL_LF_PEDANTIC
        if (ceiling(y_exp,intDsize) > len)
index 3d4aa2a2fd5cb33e19214ba6a035608cc25aeec8..d41f41d6ff7c196e58bf78a3e0ffefa3145d11c9 100644 (file)
@@ -69,7 +69,7 @@ const cl_LF operator/ (const cl_LF& x1, const cl_LF& x2)
                                      TheLfloat(x1)->sign ^ TheLfloat(x2)->sign // Vorzeichen kombinieren
                                     );
       // Nenner bilden:
-      var uintL n_len;
+      var uintC n_len;
       n_len = len2;
 #ifndef CL_LF_PEDANTIC
       if (n_len > len) { n_len = len+1; }
@@ -77,7 +77,7 @@ const cl_LF operator/ (const cl_LF& x1, const cl_LF& x2)
       // Zähler bilden:
       CL_ALLOCA_STACK;
       var uintD* z_MSDptr;
-      var uintL z_len;
+      var uintC z_len;
       var uintD* z_LSDptr;
       z_len = n_len + len + 1;
       num_stack_alloc(z_len, z_MSDptr=,z_LSDptr=);
index 7b9ba79667e00ddcf75bb9fa18acad5dc6207197..bb9c4839e5ae1bcf82bbd07450e53b54a85236a5 100644 (file)
@@ -36,7 +36,7 @@ const cl_LF cl_I_to_LF (const cl_I& x, uintC len)
       if (eq(x,0)) { return encode_LF0(len); } // x=0 -> Ergebnis 0.0
       var cl_signean sign = -(cl_signean)minusp(x); // Vorzeichen von x
       var cl_I abs_x = (sign==0 ? x : -x);
-      var uintL exp = integer_length(abs_x); // (integer-length x) < intDsize*2^intCsize
+      var uintC exp = integer_length(abs_x); // (integer-length x) < intDsize*2^intCsize
       // Teste, ob exp <= LF_exp_high-LF_exp_mid :
       if (   (log2_intDsize+intCsize < 32)
           && ((uintL)(intDsize*bitc(intCsize)-1) <= (uintL)(LF_exp_high-LF_exp_mid))
index 58f9db1600a10f63ff8ae39e91633bcfef057154..e1808728a7e4ce729757ed4dfa12f482a19e69da 100644 (file)
@@ -55,21 +55,21 @@ const cl_LF cl_RA_to_LF (const cl_RA& x, uintC len)
       var const cl_I& b = denominator(x); // b
       var cl_signean sign = -(cl_signean)minusp(a); // Vorzeichen
       if (!(sign==0)) { a = -a; } // Betrag nehmen, liefert a
-      var sintL lendiff = (sintL)integer_length(a) // (integer-length a)
-                          - (sintL)integer_length(b); // (integer-length b)
+      var sintC lendiff = (sintC)integer_length(a) // (integer-length a)
+                          - (sintC)integer_length(b); // (integer-length b)
       // |lendiff| < intDsize*2^intCsize. Da für LF-Exponenten ein sintL zur
       // Verfügung steht, braucht man keinen Test auf Overflow oder Underflow.
-      var uintL difflimit = intDsize*(uintL)len + 1; // 16n+1
+      var uintC difflimit = intDsize*len + 1; // 16n+1
       var cl_I zaehler;
       var cl_I nenner;
-      if (lendiff > (sintL)difflimit)
+      if (lendiff > (sintC)difflimit)
         // 0 <= k-m-16n-1 < k < intDsize*2^intCsize
-        { nenner = ash(b,(uintL)(lendiff - difflimit));
+        { nenner = ash(b,(uintC)(lendiff - difflimit));
           zaehler = a;
         }
         else
         // 0 < -k+m+16n+1 <= m+1 + 16n < intDsize*2^intCsize + intDsize*2^intCsize
-        { zaehler = ash(a,(uintL)(difflimit - lendiff)); // (ash a -k+m+16n+1)
+        { zaehler = ash(a,(uintC)(difflimit - lendiff)); // (ash a -k+m+16n+1)
           nenner = b; // b
         }
       // Division zaehler/nenner durchführen:
index 18bc495d6a59b9440d748849e4391a72b9182752..8decf62d8cea6b0bcf1c8a9e1d6d7145e63ad066 100644 (file)
@@ -29,7 +29,7 @@ const cl_LF fround (const cl_LF& x)
       var uintC mantlen;
       LF_decode(x, { return x; }, sign=,exp=,mantMSDptr=,mantlen=,);
       if (exp<0) { return encode_LF0(mantlen); } // e<0 -> Ergebnis 0.0
-      if ((uintL)exp >= intDsize*(uintL)mantlen) // e>=16n -> x als Ergebnis
+      if ((uintL)exp >= intDsize*mantlen) // e>=16n -> x als Ergebnis
         { return x; }
         else
         // 0 <= e < 16n
@@ -81,7 +81,7 @@ const cl_LF fround (const cl_LF& x)
           return encode_LF0(len); // e<0 -> Ergebnis 0.0
         }
       var uintL exp = uexp - LF_exp_mid;
-      if (exp >= intDsize*(uintL)len) // e>=16n -> x als Ergebnis
+      if (exp >= intDsize*len) // e>=16n -> x als Ergebnis
         { return x; }
       // 0 <= e < 16n
       // alle hinteren 16n-e Bits wegrunden:
index a9a2616d73e5ad5630ee1c7ff539487c5f7a2428..764d732fb0c07e503508f12946904de36a4eaa78 100644 (file)
@@ -29,7 +29,7 @@ const cl_LF ftruncate (const cl_LF& x)
       var uintC mantlen;
       LF_decode(x, { return x; }, sign=,exp=,mantMSDptr=,mantlen=,);
       if (exp<=0) { return encode_LF0(mantlen); } // e<=0 -> Ergebnis 0.0
-      if ((uintL)exp >= intDsize*(uintL)mantlen) // e>=16n -> x als Ergebnis
+      if ((uintL)exp >= intDsize*mantlen) // e>=16n -> x als Ergebnis
         { return x; }
         else
         // 0 < e < 16n
@@ -54,7 +54,7 @@ const cl_LF ftruncate (const cl_LF& x)
           return encode_LF0(len); // e<=0 -> Ergebnis 0.0
         }
       var uintL exp = uexp - LF_exp_mid;
-      if (exp >= intDsize*(uintL)len) // e>=16n -> x als Ergebnis
+      if (exp >= intDsize*len) // e>=16n -> x als Ergebnis
         { return x; }
       // 0 < e < 16n
       var Lfloat y = allocate_lfloat(len,uexp,TheLfloat(x)->sign); // neues Long-Float
index c0441948133e2f6a98e0949649d7e0eb699c2d84..fe31e900dfa3f176a98cd292fb53d381b97612dd 100644 (file)
@@ -34,7 +34,7 @@ const cl_LF futruncate (const cl_LF& x)
       var uintC mantlen;
       LF_decode(x, { return x; }, sign=,exp=,mantMSDptr=,mantlen=,);
       if (exp<=0) { return encode_LF1s(sign,mantlen); } // e<=0 -> Ergebnis +-1.0
-      if ((uintL)exp >= intDsize*(uintL)mantlen) // e>=16n -> x als Ergebnis
+      if ((uintL)exp >= intDsize*mantlen) // e>=16n -> x als Ergebnis
         { return x; }
         else
         // 0 < e < 16n
@@ -70,7 +70,7 @@ const cl_LF futruncate (const cl_LF& x)
           return encode_LF1s(TheLfloat(x)->sign,len); // e<=0 -> Ergebnis +-1.0
         }
       var uintL exp = uexp - LF_exp_mid;
-      if (exp >= intDsize*(uintL)len) // e>=16n -> x als Ergebnis
+      if (exp >= intDsize*len) // e>=16n -> x als Ergebnis
         { return x; }
       // 0 < e < 16n
       // Testen, ob alle hinteren 16n-e Bits =0 sind:
index bcbb51943557dc19f7568c2445b05cab90b717b2..3ec490954df1315fbb35a0d39475ab03e9a3847a 100644 (file)
@@ -15,7 +15,7 @@
 
 namespace cln {
 
-const cl_LF scale_float (const cl_LF& x, sintL delta)
+const cl_LF scale_float (const cl_LF& x, sintC delta)
 {
   // Methode:
   // delta=0 -> x als Ergebnis
@@ -25,7 +25,7 @@ const cl_LF scale_float (const cl_LF& x, sintL delta)
       if (delta == 0) { return x; } // delta=0 -> x als Ergebnis
       var uintL uexp = TheLfloat(x)->expo;
       if (uexp==0) { return x; }
-      var uintL udelta = delta;
+      var uintC udelta = delta;
       if (delta >= 0) {
         // udelta = delta >=0
        if (   ((uexp = uexp+udelta) < udelta) // Exponent-Ãœberlauf?
@@ -33,8 +33,8 @@ const cl_LF scale_float (const cl_LF& x, sintL delta)
           )
          { cl_error_floating_point_overflow(); }
       } else {
-        // delta <0, udelta = 2^32+delta
-       if (   ((uexp = uexp+udelta) >= udelta) // oder Exponent-Unterlauf?
+        // delta <0, udelta = 2^intCsize+delta
+       if (   ((uintL)(-(uexp = uexp+udelta)) <= (uintC)(-udelta)) // oder Exponent-Unterlauf?
            || (uexp < LF_exp_low) // oder Exponent zu klein?
           )
          { cl_error_floating_point_underflow(); }
index c0f32baf43cf146efbf37f680cff6381cab3a844..d91421e3871ce08ba4d93cbe537c125b6ba5ef6d 100644 (file)
@@ -42,7 +42,7 @@ const cl_I cl_LF_to_I (const cl_LF& x)
       // Vorzeichen*Mantisse ist die DS MSDptr/len1/LSDptr.
       // (ASH Vorzeichen*Mantisse (- e 16n)) durchführen:
       return ash(DS_to_I(MSDptr,len1),
-                 minus(uexp, LF_exp_mid + intDsize*(uintL)len)
+                 minus(uexp, LF_exp_mid + intDsize*len)
                 );
 }
 
index 76a8139207caa44f97ec0eacfe7a431efdf66a67..d1e323af32d814757ee41dfdc2f8c0366fb0f3bc 100644 (file)
@@ -14,9 +14,9 @@
 namespace cln {
 
 MAYBE_INLINE
-uintL float_digits (const cl_LF& x)
+uintC float_digits (const cl_LF& x)
 {
-       return intDsize*(uintL)(TheLfloat(x)->len);
+       return intDsize*(uintC)(TheLfloat(x)->len);
 }
 
 }  // namespace cln
index 06c8d0948241e5ad0dec62857882f4be2bcd0738..b21490c3b0cdebca140fa3b6b3fc589c39497f04 100644 (file)
@@ -34,7 +34,7 @@ const cl_idecoded_float integer_decode_float (const cl_LF& x)
                // Mantisse
                mant,
                // e-intDsize*n = uexp-LF_exp_mid-intDsize*n als Integer
-               minus(uexp, LF_exp_mid + intDsize*(uintL)len),
+               minus(uexp, LF_exp_mid + intDsize*len),
                (sign>=0 ? cl_I(1) : cl_I(-1)) // (-1)^s erzeugen
               );
 }
index b05c87551b39a031c14c85d3d3312333d502394f..4266867c627db83ed076ebd415dac05af86b7a24 100644 (file)
@@ -27,9 +27,9 @@ uintC cl_LF_len_incsqrt (uintC n)
 // <==>       intDsize*n < intDsize^2*inc^2 - 4*intDsize*inc + 4
 // <==>       n <= intDsize*inc^2 - 4*inc
        return
-         #define NMAX(k)  (uintL)((intDsize*(k)-4)*(k))
+         #define NMAX(k)  (uintC)((intDsize*(k)-4)*(k))
          #define FITS(n,k)  ((n) <= NMAX(k))
-         #define n_max  (uintL)(bitm(intCsize)-1)
+         #define n_max  (uintC)(bitm(intCsize)-1)
          #define TRYINC(inc)  FITS(n_max,inc) || FITS(n,inc) ? RETINC(inc) :
          #define RETINC(inc)  \
            /* at this point we know  n <= NMAX(inc) */                 \
index 76620d66e5380f4f6ff10c9df14c044b89e81f19..0a670f6c7767d17651ab0e5a8162dc88019bd8d5 100644 (file)
@@ -20,9 +20,9 @@ uintC cl_LF_len_incsqrtx (uintC n)
 // <==>       intDsize*n < intDsize^2*inc^2 - 66*intDsize*inc + 1089
 // <==>       n <= intDsize*inc^2 - 66*inc + floor(1089/intDsize)
        return
-         #define NMAX(k)  (uintL)((intDsize*(k)-66)*(k)+floor(1089,intDsize))
+         #define NMAX(k)  (uintC)((intDsize*(k)-66)*(k)+floor(1089,intDsize))
          #define FITS(n,k)  ((intDsize*(k) > 33) && ((n) <= NMAX(k)))
-         #define n_max  (uintL)(bitm(intCsize)-1)
+         #define n_max  (uintC)(bitm(intCsize)-1)
          #define TRYINC(inc)  FITS(n_max,inc) || FITS(n,inc) ? RETINC(inc) :
          #define RETINC(inc)  \
            /* at this point we know  n <= NMAX(inc) */                 \
index 2a2a411bd55a246a9254563cdca734a8909663ce..90c02478ae46b7f05f3da1f8d7e94f76bf806c9f 100644 (file)
 namespace cln {
 
 MAYBE_INLINE2
-uintL float_precision (const cl_LF& x)
+uintC float_precision (const cl_LF& x)
 {
        if (zerop(x)) return 0;
-       return intDsize*(uintL)(TheLfloat(x)->len);
+       return intDsize*(uintC)(TheLfloat(x)->len);
 }
 
 }  // namespace cln
index e37e72e435a39af6e633b854d3cc6faaed3e80db..3207bdac1b0903c76e27416c0b1e4a5ef30567ea 100644 (file)
@@ -29,11 +29,11 @@ const cl_LF cl_LF_shortenrelative (const cl_LF& x, const cl_LF& y)
        // 1 ulp(x) = 2^(ex-dx), 1 ulp(y) = 2^(ey-dy).
        // Falls ex-dx < ey-dy, x von Precision dx auf dy-ey+ex verkürzen.
        var sintL ey = float_exponent(y);
-       var sintL dy = float_precision(y);
+       var sintC dy = float_precision(y);
        if (dy==0) // zerop(y) ?
                cl_abort();
        var sintL ex = float_exponent(x);
-       var sintL dx = float_precision(x);
+       var sintC dx = float_precision(x);
        if (dx==0) // zerop(x) ?
                return x;
        var sintL d = ex - ey;
@@ -43,11 +43,11 @@ const cl_LF cl_LF_shortenrelative (const cl_LF& x, const cl_LF& y)
                return LF_to_LF(x,LF_minlen);
        if (d >= dx - dy)
                return x;
-       var uintL new_dx = dy + d;
-       var uintL len = ceiling(new_dx,intDsize);
+       var uintC new_dx = dy + d;
+       var uintC len = ceiling(new_dx,intDsize);
        if (len < LF_minlen)
                len = LF_minlen;
-       if (intDsize*len < (uintL)dx)
+       if (intDsize*len < (uintC)dx)
                return shorten(x,len);
        else
                return x;
index 551c00e4fb19365098f1b6c372f2f49c1352e63b..f0ed7446983ddcde96494a4723254f583a70dd8b 100644 (file)
@@ -29,7 +29,7 @@ const cl_LF cl_LF_shortenwith (const cl_LF& x, const cl_LF& y)
        // Falls ex-dx < ey, x von Precision dx auf ex-ey verkürzen.
        var sintL ey = float_exponent(y);
        var sintL ex = float_exponent(x);
-       var uintL dx = float_precision(x);
+       var uintC dx = float_precision(x);
        if (dx==0) // zerop(x) ?
                return x;
        var sintL ulpx = ex - dx;
index 0c2212d404ecd337c99682aee4d110f3427f4064..635063d64f587194a25d985c6edc6bb8c9ae4158 100644 (file)
@@ -20,7 +20,7 @@
 
 namespace cln {
 
-uintL float_digits (const cl_F& x)
+uintC float_digits (const cl_F& x)
 {
        floatcase(x
        ,       return float_digits(x);
index 89935d89b5ec1cc0762147042a87b869907ff6d4..8a8ba5a5440f5ecb7ef0ed5d17ef298b00ac20fe 100644 (file)
@@ -38,7 +38,7 @@ static const cl_DF DF_negative_epsilon =
 
 inline const cl_LF LF_negative_epsilon (uintC len)
 {
-       var Lfloat erg = allocate_lfloat(len,LF_exp_mid-intDsize*(uintL)len,0);
+       var Lfloat erg = allocate_lfloat(len,LF_exp_mid-intDsize*len,0);
        var uintD* ptr = &TheLfloat(erg)->data[0];
        #if CL_DS_BIG_ENDIAN_P
          *ptr++ = bit(intDsize-1);
@@ -54,7 +54,7 @@ inline const cl_LF LF_negative_epsilon (uintC len)
 
 const cl_F float_negative_epsilon (float_format_t f)
 {
-       floatformatcase((uintL)f
+       floatformatcase((uintC)f
        ,       return SF_negative_epsilon;
        ,       return FF_negative_epsilon;
        ,       return DF_negative_epsilon;
index 52385c01b0ef22aa02645674f4d7b3b3dd6faa4e..f3ade60722ab5950d6902beb78786f2e4ded1ef0 100644 (file)
@@ -37,7 +37,7 @@ static const cl_DF DF_epsilon =
 
 inline const cl_LF LF_epsilon (uintC len)
 {
-       var Lfloat erg = allocate_lfloat(len,LF_exp_mid+1-intDsize*(uintL)len,0);
+       var Lfloat erg = allocate_lfloat(len,LF_exp_mid+1-intDsize*len,0);
        var uintD* ptr = &TheLfloat(erg)->data[0];
        #if CL_DS_BIG_ENDIAN_P
          *ptr++ = bit(intDsize-1);
@@ -53,7 +53,7 @@ inline const cl_LF LF_epsilon (uintC len)
 
 const cl_F float_epsilon (float_format_t f)
 {
-       floatformatcase((uintL)f
+       floatformatcase((uintC)f
        ,       return SF_epsilon;
        ,       return FF_epsilon;
        ,       return DF_epsilon;
index 8e669e88088a1b8601f6158b61f19c653c09a01d..63a01ce9c8909b435931f42baeb5b7d6ed76870a 100644 (file)
@@ -49,7 +49,7 @@ inline const cl_LF least_negative_LF (uintC len)
 
 const cl_F least_negative_float (float_format_t f)
 {
-       floatformatcase((uintL)f
+       floatformatcase((uintC)f
        ,       return least_negative_SF;
        ,       return least_negative_FF;
        ,       return least_negative_DF;
index d85014e7e2c25318add66d031f492703b10fe049..16fdecc9877e054385286f79336fa9a0d96603c7 100644 (file)
@@ -49,7 +49,7 @@ inline const cl_LF least_positive_LF (uintC len)
 
 const cl_F least_positive_float (float_format_t f)
 {
-       floatformatcase((uintL)f
+       floatformatcase((uintC)f
        ,       return least_positive_SF;
        ,       return least_positive_FF;
        ,       return least_positive_DF;
index 1aa14b20b551aad903705056083f8fe91c314624..ca1d467114649bcb08c07fcd9132863fbb68a0a4 100644 (file)
@@ -43,7 +43,7 @@ inline const cl_LF most_negative_LF (uintC len)
 
 const cl_F most_negative_float (float_format_t f)
 {
-       floatformatcase((uintL)f
+       floatformatcase((uintC)f
        ,       return most_negative_SF;
        ,       return most_negative_FF;
        ,       return most_negative_DF;
index ee3a42fb12d0bf7fdc1743c031290b8767bae30d..daed6864e673008fa5ac7e870bc4a7036bf3582c 100644 (file)
@@ -43,7 +43,7 @@ inline const cl_LF most_positive_LF (uintC len)
 
 const cl_F most_positive_float (float_format_t f)
 {
-       floatformatcase((uintL)f
+       floatformatcase((uintC)f
        ,       return most_positive_SF;
        ,       return most_positive_FF;
        ,       return most_positive_DF;
index a2a167c53ba1e31744fba3498b73ba113f7a7782..ab4f2154a94d8fe3d1661d854fc82f4127b83290 100644 (file)
@@ -20,7 +20,7 @@
 
 namespace cln {
 
-uintL float_precision (const cl_F& x)
+uintC float_precision (const cl_F& x)
 {
        floatcase(x
        ,       return float_precision(x);
index fdbc1ff8124cbf3c5e8f375135a21aad0767f916..e14590a63cb0960bc4892df39e7f91a7f04f7cd4 100644 (file)
@@ -38,14 +38,14 @@ const cl_RA rational (const cl_F& x)
                // 0 < -e <= LF_exp_mid-LF_exp_low + intDsize*len < 2^32,
                var cl_I minus_e = -e;
                var uintL _e = cl_I_to_UL(minus_e); // daher kein Ãœberlauf
-               var uintL k = ord2(n);
+               var uintC k = ord2(n);
                if (k >= _e)
                        // Kürze mit 2^(-e).
                        return ash(n,e);
                else
                        // Kürze mit 2^k, 0 <= k < -e.
-                       return I_I_to_RT(ash(n,-(sintL)k),
-                                        ash(1,minus_e-UL_to_I(k)));
+                       return I_I_to_RT(ash(n,-(sintC)k),
+                                        ash(1,minus_e-(cl_I)(unsigned long)k));
 #endif
        }
 }
index 2438a7679d856d4edf14bf3d827d21c3c8195263..d4bea6dc274d2e03f8c2eeb606b48b457a54d439 100644 (file)
@@ -23,11 +23,11 @@ const cl_F cl_F_shortenrelative (const cl_F& x, const cl_F& y)
        // 1 ulp(x) = 2^(ex-dx), 1 ulp(y) = 2^(ey-dy).
        // Falls ex-dx < ey-dy, x von Precision dx auf dy-ey+ex verkürzen.
        var sintL ey = float_exponent(y);
-       var sintL dy = float_precision(y);
+       var sintC dy = float_precision(y);
        if (dy==0) // zerop(y) ?
                cl_abort();
        var sintL ex = float_exponent(x);
-       var sintL dx = float_precision(x);
+       var sintC dx = float_precision(x);
        if (dx==0) // zerop(x) ?
                return x;
        var sintL d = ex - ey;
@@ -37,12 +37,12 @@ const cl_F cl_F_shortenrelative (const cl_F& x, const cl_F& y)
                return cl_F_to_SF(x);
        if (d >= dx - dy)
                return x;
-       var uintL new_dx = dy + d;
+       var uintC new_dx = dy + d;
        floatformatcase(new_dx
        ,       return cl_F_to_SF(x);
        ,       return cl_F_to_FF(x);
        ,       return cl_F_to_DF(x);
-       ,       if (intDsize*len < (uintL)dx)
+       ,       if (intDsize*len < (uintC)dx)
                        return shorten(The(cl_LF)(x),len);
                else
                        return x;
index 993b44bb5771903c5aed6d40662e3650a95866dc..79d182c1052aa237995b4b25b7091d99b66a6f3e 100644 (file)
@@ -80,7 +80,7 @@ static const cl_decimal_decoded_float decode_float_decimal (const cl_F& x)
   // x/=0, also ist sign das Vorzeichen von x und
   // |x| = 2^binexpo * float(binmant,x) . Ab jetzt oBdA x>0.
   // Also x = 2^binexpo * float(binmant,x) .
-  var uintL l = integer_length(binmant); // Anzahl der Bits von binmant, >=3
+  var uintC l = integer_length(binmant); // Anzahl der Bits von binmant, >=3
   var cl_I binmant2 = ash(binmant,1); // 2*binmant
   var cl_I oben = plus1(binmant2); // obere Intervallgrenze ist
                                    // (x+x2)/2 = 2^(binexpo-1) * oben
@@ -101,7 +101,7 @@ static const cl_decimal_decoded_float decode_float_decimal (const cl_F& x)
   // Wandle dazu 2^e := 2^(binexpo-1) ins Dezimalsystem um.
   var cl_I e = binexpo - 1;
   var bool e_gross = (abs(e) > ash(l,1)); // Ist |e| recht groß, >2*l ?
-  var uintL g;     // Hilfsvariablen für den Fall, daß |e| groß ist
+  var uintC g;     // Hilfsvariablen für den Fall, daß |e| groß ist
   var cl_I f;      //
   var cl_I zehn_d; // Hilfsvariable 10^|d| für den Fall, daß |e| klein ist
   var cl_I d;  // Ergebnisvariablen
index 64c6dc0672c16a9aacee98d4d25072e999bd1769..80cb9a8835e2ff56c9c21a2c54d6f5977cd463bc 100644 (file)
@@ -17,10 +17,10 @@ namespace cln {
 
 const cl_F random_F (random_state& randomstate, const cl_F& n)
 {
-       var uintL d = float_digits(n); // d = (float-digits n) > 0
+       var uintC d = float_digits(n); // d = (float-digits n) > 0
        // Bilde neue UDS mit d Zufallsbits:
        CL_ALLOCA_STACK;
-       var uintL len = ceiling(d,intDsize);
+       var uintC len = ceiling(d,intDsize);
        var uintD* MSDptr;
        num_stack_alloc_1(len,MSDptr=,);
        random_UDS(randomstate,MSDptr,len); // len (>0) Zufallsdigits
@@ -30,7 +30,7 @@ const cl_F random_F (random_state& randomstate, const cl_F& n)
        var cl_I mant = UDS_to_I(MSDptr,len);
        // Bilde  Zufalls-Float zwischen 0 und 1
        //        = (scale-float (float Zufalls-Integer,d_Bits n) (- d)) :
-       var cl_F result = scale_float(cl_float(mant,n),-(sintL)d) * n;
+       var cl_F result = scale_float(cl_float(mant,n),-(sintC)d) * n;
        // result ist ein Zufalls-Float >=0, <=n.
        if (result == n)
                // falls (durch Rundung) result=n, durch 0 ersetzen:
index 1ba7b772c387583dfefdf375937329cd2cabdc22..e3f0029e1e618ff6f2fc8b72ac0ae9822671b350 100644 (file)
@@ -33,7 +33,7 @@ const cl_SF cl_I_to_SF (const cl_I& x)
       if (eq(x,0)) { return SF_0; }
       var cl_signean sign = -(cl_signean)minusp(x); // Vorzeichen
       var cl_I abs_x = (sign==0 ? x : -x);
-      var uintL exp = integer_length(abs_x); // (integer-length x)
+      var uintC exp = integer_length(abs_x); // (integer-length x)
       // NDS zu |x|>0 bilden:
       var const uintD* MSDptr;
       var uintC len;
index fb866cf5cbf79098a3a22add0929012ce0bc1b28..fe5eec18a5af632f6939d14c0a1ecc6dd0112d23 100644 (file)
@@ -40,8 +40,8 @@ const cl_SF cl_RA_to_SF (const cl_RA& x)
       var const cl_I& b = denominator(x); // b
       var cl_signean sign = -(cl_signean)minusp(a); // Vorzeichen
       if (!(sign==0)) { a = -a; } // Betrag nehmen, liefert a
-      var sintL lendiff = (sintL)integer_length(a) // (integer-length a)
-                          - (sintL)integer_length(b); // (integer-length b)
+      var sintC lendiff = (sintC)integer_length(a) // (integer-length a)
+                          - (sintC)integer_length(b); // (integer-length b)
       if (lendiff > SF_exp_high-SF_exp_mid) // Exponent >= n-m > Obergrenze ?
         { cl_error_floating_point_overflow(); } // -> Overflow
       if (lendiff < SF_exp_low-SF_exp_mid-2) // Exponent <= n-m+2 < Untergrenze ?
index 7e7e142b372de7d22b54016b4fff12aded39d02c..e88afdeba19d92872040309bfb6c2c68d039b5b7 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace cln {
 
-const cl_SF scale_float (const cl_SF& x, sintL delta)
+const cl_SF scale_float (const cl_SF& x, sintC delta)
 {
   // Methode:
   // x=0.0 -> x als Ergebnis
@@ -27,7 +27,7 @@ const cl_SF scale_float (const cl_SF& x, sintL delta)
       SF_decode(x, { return x; }, sign=,exp=,mant=);
       if (delta >= 0)
         // delta>=0
-        { var uintL udelta = delta;
+        { var uintC udelta = delta;
           if (udelta <= (uintL)(SF_exp_high-SF_exp_low))
             { exp = exp+udelta;
               return encode_SF(sign,exp,mant);
@@ -37,7 +37,7 @@ const cl_SF scale_float (const cl_SF& x, sintL delta)
         }
         else
         // delta<0
-        { var uintL udelta = -delta;
+        { var uintC udelta = -delta;
           if (udelta <= (uintL)(SF_exp_high-SF_exp_low))
             { exp = exp-udelta;
               return encode_SF(sign,exp,mant);
index 35043de89f1a084775834d65a9d7ef2c5a5c7da6..378a287d34e4be2862642e0dab63fe5f6bcd4801 100644 (file)
@@ -14,7 +14,7 @@
 namespace cln {
 
 MAYBE_INLINE
-uintL float_digits (const cl_SF& x)
+uintC float_digits (const cl_SF& x)
 {
        unused x;
        return SF_mant_len+1; // 17
index 68e17d42b70d71b955babec65a4b0e0400c99828..5752264ee7d04aa770324d3331a10aefc1b43ba2 100644 (file)
@@ -18,7 +18,7 @@
 namespace cln {
 
 MAYBE_INLINE2
-uintL float_precision (const cl_SF& x)
+uintC float_precision (const cl_SF& x)
 {
        if (zerop(x)) return 0;
        return SF_mant_len+1; // 17
index fc732eb1badbbff78adad4d33f06cfd83bd55ca2..2d15ede2f1122349043c856b8f93c6ad0ad02b88 100644 (file)
@@ -51,10 +51,10 @@ const cl_LF atanhx (const cl_LF& x)
 {
        if (zerop(x))
                return x;
-       var uintL actuallen = TheLfloat(x)->len;
-       var uintL d = float_digits(x);
+       var uintC actuallen = TheLfloat(x)->len;
+       var uintC d = float_digits(x);
        var sintL e = float_exponent(x);
-       if (e <= (sintL)(-d)>>1) // e <= -d/2 <==> e <= -ceiling(d/2)
+       if (e <= (sintC)(-d)>>1) // e <= -d/2 <==> e <= -ceiling(d/2)
                return x; // ja -> x als Ergebnis
        if (actuallen >= 34) {
                DeclareType(cl_LF,x);
@@ -105,7 +105,7 @@ const cl_LF atanhx (const cl_LF& x)
        } else {
                // naive2:
                // floating-point representation with smooth precision reduction
-               var cl_LF eps = scale_float(b,-(sintL)d-10);
+               var cl_LF eps = scale_float(b,-(sintC)d-10);
                loop {
                        var cl_LF new_sum = sum + LF_to_LF(b/(cl_I)i,actuallen); // (+ sum (/ b i))
                        if (new_sum == sum) // = sum ?
@@ -129,9 +129,9 @@ const cl_F atanhx (const cl_F& x)
        }
        if (zerop(x))
                return x;
-       var uintL d = float_digits(x);
+       var uintC d = float_digits(x);
        var sintL e = float_exponent(x);
-       if (e <= (sintL)(-d)>>1) // e <= -d/2 <==> e <= -ceiling(d/2)
+       if (e <= (sintC)(-d)>>1) // e <= -d/2 <==> e <= -ceiling(d/2)
                return x; // ja -> x als Ergebnis
        var uintL k = 0; // Rekursionszähler k:=0
        // Bei e <= -1-limit_slope*floor(sqrt(d)) kann die Potenzreihe
index 9a8cc1048d9685b0611dedfe7ec85c69fe279783..ad852a1bc4864231e6f25e19054cbf2b4f34ec35 100644 (file)
@@ -49,10 +49,10 @@ static const cl_LF atanx_naive (const cl_LF& x)
 {
        if (zerop(x))
                return x;
-       var uintL actuallen = TheLfloat(x)->len;
-       var uintL d = float_digits(x);
+       var uintC actuallen = TheLfloat(x)->len;
+       var uintC d = float_digits(x);
        var sintL e = float_exponent(x);
-       if (e <= (sintL)(-d)>>1) // e <= -d/2 <==> e <= -ceiling(d/2)
+       if (e <= (sintC)(-d)>>1) // e <= -d/2 <==> e <= -ceiling(d/2)
                return x; // ja -> x als Ergebnis
        var uintL k = 0; // Rekursionszähler k:=0
        // Bei e <= -1-limit_slope*floor(sqrt(d)) kann die Potenzreihe
@@ -99,7 +99,7 @@ static const cl_LF atanx_naive (const cl_LF& x)
        } else {
                // naive2:
                // floating-point representation with smooth precision reduction
-               var cl_LF eps = scale_float(b,-(sintL)d-10);
+               var cl_LF eps = scale_float(b,-(sintC)d-10);
                loop {
                        var cl_LF new_sum = sum + LF_to_LF(b/(cl_I)i,actuallen); // (+ sum (/ b i))
                        if (new_sum == sum) // = sum ?
@@ -119,9 +119,9 @@ static const cl_F atanx_naive (const cl_F& x)
 {
        if (zerop(x))
                return x;
-       var uintL d = float_digits(x);
+       var uintC d = float_digits(x);
        var sintL e = float_exponent(x);
-       if (e <= (sintL)(-d)>>1) // e <= -d/2 <==> e <= -ceiling(d/2)
+       if (e <= (sintC)(-d)>>1) // e <= -d/2 <==> e <= -ceiling(d/2)
                return x; // ja -> x als Ergebnis
        var uintL k = 0; // Rekursionszähler k:=0
        var uintL sqrt_d = floor(isqrt(d),2); // limit_slope*floor(sqrt(d))
@@ -183,21 +183,21 @@ static const cl_LF atanx_ratseries (const cl_LF& t)
        //       z' = truncate(y*2^(2n))/2^(2n).
        //   Set z := z + z' and x+i*y := (x+i*y)*exp(-i*z').
        var uintC len = TheLfloat(t)->len;
-       var uintL d = intDsize*(uintL)len;
-       if (zerop(t) || (float_exponent(t) <= (sintL)(-d)>>1))
+       var uintC d = intDsize*len;
+       if (zerop(t) || (float_exponent(t) <= (sintC)(-d)>>1))
                return t;
        var cl_LF x = recip(sqrt(cl_I_to_LF(1,len) + square(t)));
        var cl_LF y = t*x;
        var cl_LF z = cl_I_to_LF(0,len);
        loop {
-               if (zerop(y) || (float_exponent(y) <= (sintL)(-d)>>1))
+               if (zerop(y) || (float_exponent(y) <= (sintC)(-d)>>1))
                        break;
                var cl_idecoded_float y_ = integer_decode_float(y);
                // y = (-1)^sign * 2^exponent * mantissa
-               var uintL lm = integer_length(y_.mantissa);
+               var uintC lm = integer_length(y_.mantissa);
                var uintL me = cl_I_to_UL(- y_.exponent);
                var cl_I p;
-               var uintL lq;
+               var uintC lq;
                var cl_boolean last_step = cl_false;
                if (lm >= me) { // |y| >= 1/2 ?
                        p = y_.sign; // 1 or -1
@@ -221,7 +221,7 @@ static const cl_LF atanx_ratseries (const cl_LF& t)
                        if (2*n >= lm)
                                last_step = cl_true;
                }
-               z = z + scale_float(cl_I_to_LF(p,len),-(sintL)lq);
+               z = z + scale_float(cl_I_to_LF(p,len),-(sintC)lq);
                if (last_step)
                        break;
                var cl_LF_cos_sin_t cis_z = cl_cossin_aux(-p,lq,len);
index bd40e28d18c108c44a55e1c5797c53a4030907c1..bbdc1767712b6202cfe8191a1df29c8489eb5a0d 100644 (file)
@@ -16,7 +16,7 @@ namespace cln {
 
 const cl_F catalanconst (float_format_t f)
 {
-       floatformatcase((uintL)f
+       floatformatcase((uintC)f
        ,       return cl_SF_catalanconst;
        ,       return cl_FF_catalanconst;
        ,       return cl_DF_catalanconst;
index 4c18531c019dac7364e8685d2df2045d1ca06271..1cb5a5e284c57f19a24fdb013450a75d3a938af7 100644 (file)
@@ -51,7 +51,7 @@ const cl_F cos (const cl_F& x)
                        var cl_F_div_t q_r = cl_round_pi(cl_F_extendsqrt(x));
                        var cl_I& q = q_r.quotient;
                        var cl_LF r = The(cl_LF)(q_r.remainder);
-                       if (zerop(r) || (float_exponent(r) <= (-(sintL)float_digits(r))>>1))
+                       if (zerop(r) || (float_exponent(r) <= (-(sintC)float_digits(r))>>1))
                                cos_r = cl_float(1,x); // (cos r) = 1.0
                        else {
                                var cl_LF s = scale_float(r,-1); // s := r/2
@@ -66,7 +66,7 @@ const cl_F cos (const cl_F& x)
                var cl_F_div_t q_r = cl_round_pi(cl_F_extendsqrt(x));
                var cl_I& q = q_r.quotient;
                var cl_F& r = q_r.remainder;
-               if (zerop(r) || (float_exponent(r) <= (-(sintL)float_digits(r))>>1))
+               if (zerop(r) || (float_exponent(r) <= (-(sintC)float_digits(r))>>1))
                        cos_r = cl_float(1,x); // (cos r) = 1.0
                else {
                        var cl_F s = scale_float(r,-1); // s := r/2
index 3bab20181cf642ec56e27582b7ac6bfcdfa2863c..da29b1594580dc6554d91ceedf18fc75c0f5d9aa 100644 (file)
@@ -34,8 +34,8 @@ const cl_F cosh (const cl_F& x)
                // e<0
                if (zerop(x))
                        return cl_float(1,x);
-               var uintL d = float_digits(x);
-               if (e <= (1-(sintL)d)>>1) // e <= (1-d)/2 <==> e <= -ceiling((d-1)/2) ?
+               var uintC d = float_digits(x);
+               if (e <= (1-(sintC)d)>>1) // e <= (1-d)/2 <==> e <= -ceiling((d-1)/2) ?
                        return cl_float(1,x); // ja -> 1.0 als Ergebnis
                // Rechengenauigkeit erhöhen
                if (longfloatp(x)) {
index 171329985a9ee853b5b23b9058f457991ce9bf77..78882853ad5a86abd2e1733c942e1094df895648 100644 (file)
@@ -36,7 +36,7 @@ const cosh_sinh_t cosh_sinh (const cl_F& x)
        var sintL e = float_exponent(x);
        if (e < 0) { // Exponent e abtesten
                // e<0
-               if (zerop(x) || (e <= (1-(sintL)float_digits(x))>>1))
+               if (zerop(x) || (e <= (1-(sintC)float_digits(x))>>1))
                        // e <= (1-d)/2 <==> e <= -ceiling((d-1)/2)
                        return cosh_sinh_t(cl_float(1,x),x);
                // Rechengenauigkeit erhöhen
index ea5dede44b403d1d3d72bd7537566caab1aa6bca..486bacdf5fcd77a70e7f97fef8ab0e9c0461b1e6 100644 (file)
@@ -56,7 +56,7 @@ const cos_sin_t cos_sin (const cl_F& x)
                        var cl_LF r = The(cl_LF)(q_r.remainder);
                        var cl_LF y = sinx_naive(r); // y := sin(r)^2
                        // erste Komponente cos(r) berechnen:
-                       if (zerop(r) || (float_exponent(r) <= (-(sintL)float_digits(r))>>1))
+                       if (zerop(r) || (float_exponent(r) <= (-(sintC)float_digits(r))>>1))
                                cos_r = cl_float(1,x); // cos(r) = 1.0
                        else
                                cos_r = cl_float(sqrt(1-y),x); // cos(r) = sqrt(1-y)
@@ -71,7 +71,7 @@ const cos_sin_t cos_sin (const cl_F& x)
                var cl_F& r = q_r.remainder;
                var cl_F y = sinxbyx_naive(r); // y := (sin(r)/r)^2
                // erste Komponente cos(r) berechnen:
-               if (zerop(r) || (float_exponent(r) <= (-(sintL)float_digits(r))>>1))
+               if (zerop(r) || (float_exponent(r) <= (-(sintC)float_digits(r))>>1))
                        cos_r = cl_float(1,x); // cos(r) = 1.0
                else
                        cos_r = cl_float(sqrt(1 - square(r)*y),x); // sqrt(1-r^2*y)
index 153cbacb0f01cafb7278f8ca21cbe10eb395f0b7..e97e2cbe6019109fc5c4bf305f1a81c104bc233a 100644 (file)
@@ -16,7 +16,7 @@ namespace cln {
 
 const cl_F eulerconst (float_format_t f)
 {
-       floatformatcase((uintL)f
+       floatformatcase((uintC)f
        ,       return cl_SF_eulerconst;
        ,       return cl_FF_eulerconst;
        ,       return cl_DF_eulerconst;
index 4e23f0a5a5d8e1cda1e223e071680b0b67229c36..1e18b6d9ef0d8a2a7ee0d4d789c381d69f28ed52 100644 (file)
@@ -16,7 +16,7 @@ namespace cln {
 
 const cl_F exp1 (float_format_t f)
 {
-       floatformatcase((uintL)f
+       floatformatcase((uintC)f
        ,       return cl_SF_exp1;
        ,       return cl_FF_exp1;
        ,       return cl_DF_exp1;
index 80692646bd362dca69f3a2df6b94a392efc68111..16957230cbcd598a21d2766120b78fc1743b2ce3 100644 (file)
@@ -47,9 +47,9 @@ const cl_LF expx_naive (const cl_LF& x)
        if (zerop(x))
                return cl_float(1,x);
        var uintL actuallen = TheLfloat(x)->len;
-       var uintL d = float_digits(x);
+       var uintC d = float_digits(x);
        var sintL e = float_exponent(x);
-       if (e < -(sintL)d) // e < -d ?
+       if (e < -(sintC)d) // e < -d ?
                return cl_float(1,x); // ja -> 1.0 als Ergebnis
  {     Mutable(cl_LF,x);
        var uintL k = 0; // Rekursionszähler k:=0
@@ -66,7 +66,7 @@ const cl_LF expx_naive (const cl_LF& x)
        // Potenzreihe anwenden:
        var int i = 0;
        var cl_LF b = cl_float(1,x); // b := (float 1 x)
-       var cl_LF eps = scale_float(b,-(sintL)d-10);
+       var cl_LF eps = scale_float(b,-(sintC)d-10);
        var cl_LF sum = cl_float(0,x); // sum := (float 0 x)
        loop {
                var cl_LF new_sum = sum + LF_to_LF(b,actuallen);
@@ -93,9 +93,9 @@ const cl_F expx_naive (const cl_F& x)
        }
        if (zerop(x))
                return cl_float(1,x);
-       var uintL d = float_digits(x);
+       var uintC d = float_digits(x);
        var sintL e = float_exponent(x);
-       if (e < -(sintL)d) // e < -d ?
+       if (e < -(sintC)d) // e < -d ?
                return cl_float(1,x); // ja -> 1.0 als Ergebnis
  {     Mutable(cl_F,x);
        var uintL k = 0; // Rekursionszähler k:=0
index f4f2d84082a7410d3c9ebc5b98643e8ac59103cd..2c0332b2b89b55fe1f0264b03ce33aa387417ce5 100644 (file)
@@ -15,7 +15,7 @@ namespace cln {
 
 const cl_F cl_ln10 (float_format_t f)
 {
-       floatformatcase((uintL)f
+       floatformatcase((uintC)f
        ,       return cl_SF_ln10;
        ,       return cl_FF_ln10;
        ,       return cl_DF_ln10;
index 68faaecf56ebf68aaa5a05509935921899c3d2b2..9882bb3173f8ad625d617896ffd09898884c4abc 100644 (file)
@@ -15,7 +15,7 @@ namespace cln {
 
 const cl_F cl_ln2 (float_format_t f)
 {
-       floatformatcase((uintL)f
+       floatformatcase((uintC)f
        ,       return cl_SF_ln2;
        ,       return cl_FF_ln2;
        ,       return cl_DF_ln2;
index c2a406cc9d057e763d8506d0c8014d6327a340b2..73af9308c96ee51e39bc08efa23142a3b599add4 100644 (file)
@@ -48,9 +48,9 @@ const cl_LF lnx_naive (const cl_LF& x)
        if (zerop(y)) // y=0.0 -> y als Ergebnis
                return y;
        var uintL actuallen = TheLfloat(x)->len;
-       var uintL d = float_digits(x);
+       var uintC d = float_digits(x);
        var sintL e = float_exponent(y);
-       if (e <= -(sintL)d) // e <= -d ?
+       if (e <= -(sintC)d) // e <= -d ?
                return y; // ja -> y als Ergebnis
  {     Mutable(cl_LF,x);
        var uintL k = 0; // Rekursionszähler k:=0
@@ -88,7 +88,7 @@ const cl_LF lnx_naive (const cl_LF& x)
                } else {
                        // naive2:
                        // floating-point representation with smooth precision reduction
-                       var cl_LF eps = scale_float(b,-(sintL)d-10);
+                       var cl_LF eps = scale_float(b,-(sintC)d-10);
                        loop {
                                var cl_LF new_sum = sum + LF_to_LF(b/(cl_I)i,actuallen); // (+ sum (/ b i))
                                if (new_sum == sum) // = sum ?
@@ -121,7 +121,7 @@ const cl_LF lnx_naive (const cl_LF& x)
                } else {
                        // naive2:
                        // floating-point representation with smooth precision reduction
-                       var cl_LF eps = scale_float(b,-(sintL)d-10);
+                       var cl_LF eps = scale_float(b,-(sintC)d-10);
                        loop {
                                var cl_LF new_sum = sum + LF_to_LF(b/(cl_I)i,actuallen); // (+ sum (/ b i))
                                if (new_sum == sum) // = sum ?
@@ -146,9 +146,9 @@ const cl_F lnx_naive (const cl_F& x)
        var cl_F y = x-cl_float(1,x);
        if (zerop(y)) // y=0.0 -> y als Ergebnis
                return y;
-       var uintL d = float_digits(x);
+       var uintC d = float_digits(x);
        var sintL e = float_exponent(y);
-       if (e <= -(sintL)d) // e <= -d ?
+       if (e <= -(sintC)d) // e <= -d ?
                return y; // ja -> y als Ergebnis
  {     Mutable(cl_F,x);
        var uintL k = 0; // Rekursionszähler k:=0
@@ -200,10 +200,10 @@ const cl_LF lnx_ratseries (const cl_LF& x)
                // x1 = (-1)^sign * 2^exponent * mantissa
                if (zerop(x1_.mantissa))
                        break;
-               var uintL lm = integer_length(x1_.mantissa);
+               var uintC lm = integer_length(x1_.mantissa);
                var uintL me = cl_I_to_UL(- x1_.exponent);
                var cl_I p;
-               var uintL lq;
+               var uintC lq;
                var cl_boolean last_step = cl_false;
                if (lm >= me) { // |x'| >= 1/2 ?
                        p = x1_.sign; // 1 or -1
@@ -227,7 +227,7 @@ const cl_LF lnx_ratseries (const cl_LF& x)
                        if (2*n >= lm)
                                last_step = cl_true;
                }
-               y = y + scale_float(cl_I_to_LF(p,len),-(sintL)lq);
+               y = y + scale_float(cl_I_to_LF(p,len),-(sintC)lq);
                if (last_step)
                        break;
                x = x * cl_exp_aux(-p,lq,len);
index c8444ec8e172a7e4c6510b975e8c231796ae5811..d6ea053ff9e8875706bdfce5f03f2ebfda369468 100644 (file)
@@ -16,7 +16,7 @@ namespace cln {
 
 const cl_F pi (float_format_t f)
 {
-       floatformatcase((uintL)f
+       floatformatcase((uintC)f
        ,       return cl_SF_pi;
        ,       return cl_FF_pi;
        ,       return cl_DF_pi;
index 6411442ae001a41aa5042f4c5697b08c3f978a43..0c31bc4a9b88f405c9f2982bbaeef8f5726fd797 100644 (file)
@@ -61,7 +61,7 @@ const cl_F sin (const cl_F& x)
                                        z = -z;
                        } else {
                                // cos(r) berechnen:
-                               if (zerop(r) || (float_exponent(r) <= (-(sintL)float_digits(r))>>1))
+                               if (zerop(r) || (float_exponent(r) <= (-(sintC)float_digits(r))>>1))
                                        z = cl_float(1,x); // cos(r) = 1.0
                                else
                                        z = cl_float(sqrt(1 - y),x); // sqrt(1-y)
@@ -77,7 +77,7 @@ const cl_F sin (const cl_F& x)
                        z = cl_float(r*sqrt(y),x);
                } else {
                        // cos(r) berechnen:
-                       if (zerop(r) || (float_exponent(r) <= (-(sintL)float_digits(r))>>1))
+                       if (zerop(r) || (float_exponent(r) <= (-(sintC)float_digits(r))>>1))
                                z = cl_float(1,x); // cos(r) = 1.0
                        else
                                z = cl_float(sqrt(1 - square(r)*y),x); // sqrt(1-r^2*y)
index 7ffdb1a262c207dff4d714a303a75500d000a247..b1f0bfcece3aeec95d0c658f0eff8e3273263b13 100644 (file)
@@ -37,7 +37,7 @@ const cl_F sinh (const cl_F& x)
                        } else
                        #endif
                        if ((TheLfloat(x)->len >= 500)
-                           && (float_exponent(x) > (-(sintL)float_digits(x))>>1)) {
+                           && (float_exponent(x) > (-(sintC)float_digits(x))>>1)) {
                                // verwende exp(x), schneller als cl_coshsinh_ratseries
                                // (aber nur bei 0 > e > -d/2, denn wir müssen, um
                                // Auslöschung zu verhindern, |e| Bits dazunehmen)
index ea6d1c5a282a4134288acd8dbf3bee5d79dadb89..e5fd97c934ac9cde2f5a0585b891cb2276571523 100644 (file)
@@ -51,9 +51,9 @@ const cl_F sinhxbyx_naive (const cl_F& x)
 
        if (zerop(x))
                return cl_float(1,x);
-       var uintL d = float_digits(x);
+       var uintC d = float_digits(x);
        var sintL e = float_exponent(x);
-       if (e <= (1-(sintL)d)>>1) // e <= (1-d)/2 <==> e <= -ceiling((d-1)/2) ?
+       if (e <= (1-(sintC)d)>>1) // e <= (1-d)/2 <==> e <= -ceiling((d-1)/2) ?
                return cl_float(1,x); // ja -> 1.0 als Ergebnis
  {     Mutable(cl_F,x);
        // Bei e <= -1-limit_slope*floor(sqrt(d)) kann die Potenzreihe
@@ -115,9 +115,9 @@ const cl_LF sinhx_naive (const cl_LF& x)
        if (zerop(x))
                return x;
        var uintL actuallen = TheLfloat(x)->len;
-       var uintL d = float_digits(x);
+       var uintC d = float_digits(x);
        var sintL e = float_exponent(x);
-       if (e <= (1-(sintL)d)>>1) // e <= (1-d)/2 <==> e <= -ceiling((d-1)/2) ?
+       if (e <= (1-(sintC)d)>>1) // e <= (1-d)/2 <==> e <= -ceiling((d-1)/2) ?
                return square(x); // ja -> x^2 als Ergebnis
  {     Mutable(cl_LF,x);
        var sintL ee = e;
@@ -147,7 +147,7 @@ const cl_LF sinhx_naive (const cl_LF& x)
                        b = round1(round1(The(cl_LF)(b*a)),(cl_I)((i+1)*(i+2)));
                        i = i+2;
                }
-               powser_value = scale_float(cl_float(sum,x),-d);
+               powser_value = scale_float(cl_float(sum,x),-(sintC)d);
        } else if (actuallen <= 7) { // Break-even-Point before extendsqrt: N<=6
                // naive2:
                // floating-point representation
@@ -166,7 +166,7 @@ const cl_LF sinhx_naive (const cl_LF& x)
                // naive3:
                // floating-point representation with smooth precision reduction
                var cl_LF b = x; // b := x
-               var cl_LF eps = scale_float(b,-(sintL)d-10);
+               var cl_LF eps = scale_float(b,-(sintC)d-10);
                var cl_LF sum = cl_float(0,x); // sum := (float 0 x)
                loop {
                        var cl_LF new_sum = sum + LF_to_LF(b,actuallen);
index f74fe223ef7dfc587ea1d25499947ea21f9be830..5dc12b101d1e266ab011730f2a758f85dc91c1f6 100644 (file)
@@ -51,9 +51,9 @@ const cl_F sinxbyx_naive (const cl_F& x)
 
        if (zerop(x))
                return cl_float(1,x);
-       var uintL d = float_digits(x);
+       var uintC d = float_digits(x);
        var sintL e = float_exponent(x);
-       if (e <= (-(sintL)d)>>1) // e <= (-d)/2 <==> e <= -ceiling(d/2) ?
+       if (e <= (-(sintC)d)>>1) // e <= (-d)/2 <==> e <= -ceiling(d/2) ?
                return cl_float(1,x); // ja -> 1.0 als Ergebnis
  {     Mutable(cl_F,x);
        // Bei e <= -1-limit_slope*floor(sqrt(d)) kann die Potenzreihe
@@ -124,9 +124,9 @@ const cl_LF sinx_naive (const cl_LF& x)
        if (zerop(x))
                return x;
        var uintL actuallen = TheLfloat(x)->len;
-       var uintL d = float_digits(x);
+       var uintC d = float_digits(x);
        var sintL e = float_exponent(x);
-       if (e <= (-(sintL)d)>>1) // e <= (-d)/2 <==> e <= -ceiling(d/2) ?
+       if (e <= (-(sintC)d)>>1) // e <= (-d)/2 <==> e <= -ceiling(d/2) ?
                return square(x); // ja -> x^2 als Ergebnis
  {     Mutable(cl_LF,x);
        var sintL ee = e;
@@ -157,7 +157,7 @@ const cl_LF sinx_naive (const cl_LF& x)
                        b = round1(round1(The(cl_LF)(b*a)),(cl_I)((i+1)*(i+2)));
                        i = i+2;
                }
-               powser_value = scale_float(cl_float(sum,x),-d);
+               powser_value = scale_float(cl_float(sum,x),-(sintC)d);
        } else if (actuallen <= 7) { // Break-even-Point before extendsqrt: N<=6
                // naive2:
                // floating-point representation
@@ -176,7 +176,7 @@ const cl_LF sinx_naive (const cl_LF& x)
                // naive3:
                // floating-point representation with smooth precision reduction
                var cl_LF b = x; // b := x
-               var cl_LF eps = scale_float(b,-(sintL)d-10);
+               var cl_LF eps = scale_float(b,-(sintC)d-10);
                var cl_LF sum = cl_float(0,x); // sum := (float 0 x)
                loop {
                        var cl_LF new_sum = sum + LF_to_LF(b,actuallen);
index c49965db0f87caed4d5a996e2d710a84f9346621..739226b47a5a2a898b31b6823c9e9bb7660df12d 100644 (file)
@@ -19,7 +19,7 @@ extern const cl_LF pi (uintC len); // computes it even further
 // cl_exp_aux(p,lq,len) liefert die Zahl exp(p/2^lq) mit len Digits.
 // 0 < |p| < 2^lq.
 // Es sollte |p|^2 < 2^lq sein, sonst ist das nicht effizient.
-extern const cl_LF cl_exp_aux (const cl_I& p, uintL lq, uintC len);
+extern const cl_LF cl_exp_aux (const cl_I& p, uintC lq, uintC len);
 
 // cl_cossin_aux(p,lq,len) liefert cos(p/2^lq) und sin(p/2^lq) mit len Digits.
 // 0 < |p| < 2^lq.
@@ -31,7 +31,7 @@ struct cl_LF_cos_sin_t {
        cl_LF_cos_sin_t (const cl_LF& u, const cl_LF& v) : cos (u), sin (v) {}
        cl_LF_cos_sin_t () {}
 };
-extern const cl_LF_cos_sin_t cl_cossin_aux (const cl_I& p, uintL lq, uintC len);
+extern const cl_LF_cos_sin_t cl_cossin_aux (const cl_I& p, uintC lq, uintC len);
 
 // cl_coshsinh_aux(p,lq,len) liefert cosh(p/2^lq) und sinh(p/2^lq) mit len Digits.
 // 0 < |p| < 2^lq.
@@ -43,7 +43,7 @@ struct cl_LF_cosh_sinh_t {
        cl_LF_cosh_sinh_t (const cl_LF& u, const cl_LF& v) : cosh (u), sinh (v) {}
        cl_LF_cosh_sinh_t () {}
 };
-extern const cl_LF_cosh_sinh_t cl_coshsinh_aux (const cl_I& p, uintL lq, uintC len);
+extern const cl_LF_cosh_sinh_t cl_coshsinh_aux (const cl_I& p, uintC lq, uintC len);
 
 // atanhx(x) liefert zu einem Float x (betragsmäßig <1/2) atanh(x) als Float.
 extern const cl_F atanhx (const cl_F& x);
index 84f3cea0036652b7e4c591ff232bdd08f9e29ddb..7fd1b550cc6c4cb95a2dc89b22c039c33482c795 100644 (file)
@@ -17,7 +17,7 @@ namespace cln {
 
 const cl_F zeta (int s, float_format_t f)
 {
-       floatformatcase((uintL)f
+       floatformatcase((uintC)f
        ,       return cl_LF_to_SF(zeta(s,LF_minlen));
        ,       return cl_LF_to_FF(zeta(s,LF_minlen));
        ,       return cl_LF_to_DF(zeta(s,LF_minlen));
index a12c0ef77d3374a171c0c6cc0e20f959849ee791..832ac029bf1a2543d873936a4b6e408939b522ec 100644 (file)
@@ -29,11 +29,11 @@ const cl_LF cl_atan_recip (cl_I m, uintC len)
 {
        var uintC actuallen = len + 1;
        var cl_I m2 = m*m+1;
-       var uintL N = (uintL)(0.69314718*intDsize*actuallen/::log(double_approx(m2))) + 1;
+       var uintC N = (uintC)(0.69314718*intDsize*actuallen/::log(double_approx(m2))) + 1;
        CL_ALLOCA_STACK;
        var cl_I* pv = (cl_I*) cl_alloca(N*sizeof(cl_I));
        var cl_I* qv = (cl_I*) cl_alloca(N*sizeof(cl_I));
-       var uintL n;
+       var uintC n;
        new (&pv[0]) cl_I (m);
        new (&qv[0]) cl_I (m2);
        for (n = 1; n < N; n++) {
index b550481dddc9897989d954c87176a9f4da4bf084..113dfc014d6ce4e21e748891afc39003a4fdc1dd 100644 (file)
@@ -29,11 +29,11 @@ const cl_LF cl_atanh_recip (cl_I m, uintC len)
 {
        var uintC actuallen = len + 1;
        var cl_I m2 = m*m;
-       var uintL N = (uintL)(0.69314718*intDsize/2*actuallen/::log(double_approx(m))) + 1;
+       var uintC N = (uintC)(0.69314718*intDsize/2*actuallen/::log(double_approx(m))) + 1;
        CL_ALLOCA_STACK;
        var cl_I* bv = (cl_I*) cl_alloca(N*sizeof(cl_I));
        var cl_I* qv = (cl_I*) cl_alloca(N*sizeof(cl_I));
-       var uintL n;
+       var uintC n;
        for (n = 0; n < N; n++) {
                new (&bv[n]) cl_I ((cl_I)(2*n+1));
                new (&qv[n]) cl_I (n==0 ? m : m2);
index 866c9566eccf48f5b241e04ec475f82935c5c004..eea0258e3c4e5a39ed3fd1c2d5f05292e1374a28 100644 (file)
@@ -26,8 +26,8 @@ const cl_LF compute_catalanconst_ramanujan (uintC len)
        // Every summand gives 0.6 new decimal digits in precision.
        // The sum is best evaluated using fixed-point arithmetic,
        // so that the precision is reduced for the later summands.
-       var uintL actuallen = len + 2; // 2 Schutz-Digits
-       var sintL scale = intDsize*actuallen;
+       var uintC actuallen = len + 2; // 2 Schutz-Digits
+       var sintC scale = intDsize*actuallen;
        var cl_I sum = 0;
        var cl_I n = 0;
        var cl_I factor = ash(1,scale);
@@ -50,18 +50,18 @@ const cl_LF compute_catalanconst_ramanujan_fast (uintC len)
 {
        // Same formula as above, using a binary splitting evaluation.
        // See [Borwein, Borwein, section 10.2.3].
-       var uintL actuallen = len + 2; // 2 Schutz-Digits
+       var uintC actuallen = len + 2; // 2 Schutz-Digits
        // Evaluate a sum(0 <= n < N, a(n)/b(n) * (p(0)...p(n))/(q(0)...q(n)))
        // with appropriate N, and
        //   a(n) = 1, b(n) = 2*n+1,
        //   p(n) = n for n>0, q(n) = 2*(2*n+1) for n>0.
-       var uintL N = (intDsize/2)*actuallen;
+       var uintC N = (intDsize/2)*actuallen;
        // 4^-N <= 2^(-intDsize*actuallen).
        CL_ALLOCA_STACK;
        var cl_I* bv = (cl_I*) cl_alloca(N*sizeof(cl_I));
        var cl_I* pv = (cl_I*) cl_alloca(N*sizeof(cl_I));
        var cl_I* qv = (cl_I*) cl_alloca(N*sizeof(cl_I));
-       var uintL n;
+       var uintC n;
        init1(cl_I, bv[0]) (1);
        init1(cl_I, pv[0]) (1);
        init1(cl_I, qv[0]) (1);
@@ -92,13 +92,13 @@ const cl_LF compute_catalanconst_expintegral1 (uintC len)
 {
        // We compute f(x) classically and g(x) using the partial sums of f(x).
        var uintC actuallen = len+2; // 2 Schutz-Digits
-       var uintL x = (uintL)(0.693148*intDsize*actuallen)+1;
-       var uintL N = (uintL)(2.718281828*x);
+       var uintC x = (uintC)(0.693148*intDsize*actuallen)+1;
+       var uintC N = (uintC)(2.718281828*x);
        var cl_LF fterm = cl_I_to_LF(1,actuallen);
        var cl_LF fsum = fterm;
        var cl_LF gterm = fterm;
        var cl_LF gsum = gterm;
-       var uintL n;
+       var uintC n;
        // After n loops
        //   fterm = x^n/n!, fsum = 1 + x/1! + ... + x^n/n!,
        //   gterm = S_n*x^n/n!, gsum = S_0*x^0/0! + ... + S_n*x^n/n!.
@@ -122,11 +122,11 @@ const cl_LF compute_catalanconst_expintegral1 (uintC len)
 const cl_LF compute_catalanconst_expintegral2 (uintC len)
 {
        var uintC actuallen = len+2; // 2 Schutz-Digits
-       var uintL x = (uintL)(0.693148*intDsize*actuallen)+1;
-       var uintL N = (uintL)(2.718281828*x);
+       var uintC x = (uintC)(0.693148*intDsize*actuallen)+1;
+       var uintC N = (uintC)(2.718281828*x);
        CL_ALLOCA_STACK;
        var cl_pqd_series_term* args = (cl_pqd_series_term*) cl_alloca(N*sizeof(cl_pqd_series_term));
-       var uintL n;
+       var uintC n;
        for (n = 0; n < N; n++) {
                if (n==0) {
                        init1(cl_I, args[n].p) (1);
@@ -153,13 +153,13 @@ const cl_LF compute_catalanconst_expintegral2 (uintC len)
 const cl_LF compute_catalanconst_cvz1 (uintC len)
 {
        var uintC actuallen = len+2; // 2 Schutz-Digits
-       var uintL N = (uintL)(0.39321985*intDsize*actuallen)+1;
+       var uintC N = (uintC)(0.39321985*intDsize*actuallen)+1;
 #if 0
        var cl_LF fterm = cl_I_to_LF(2*(cl_I)N*(cl_I)N,actuallen);
        var cl_LF fsum = fterm;
        var cl_LF gterm = fterm;
        var cl_LF gsum = gterm;
-       var uintL n;
+       var uintC n;
        // After n loops
        //   fterm = (N+n)!N/(2n+2)!(N-n-1)!*2^(2n+2), fsum = ... + fterm,
        //   gterm = S_n*fterm, gsum = ... + gterm.
@@ -180,7 +180,7 @@ const cl_LF compute_catalanconst_cvz1 (uintC len)
        var cl_I fsum = fterm;
        var cl_LF gterm = cl_I_to_LF(fterm,actuallen);
        var cl_LF gsum = gterm;
-       var uintL n;
+       var uintC n;
        // After n loops
        //   fterm = (N+n)!N/(2n+2)!(N-n-1)!*2^(2n+2), fsum = ... + fterm,
        //   gterm = S_n*fterm, gsum = ... + gterm.
@@ -204,10 +204,10 @@ const cl_LF compute_catalanconst_cvz1 (uintC len)
 const cl_LF compute_catalanconst_cvz2 (uintC len)
 {
        var uintC actuallen = len+2; // 2 Schutz-Digits
-       var uintL N = (uintL)(0.39321985*intDsize*actuallen)+1;
+       var uintC N = (uintC)(0.39321985*intDsize*actuallen)+1;
        CL_ALLOCA_STACK;
        var cl_pqd_series_term* args = (cl_pqd_series_term*) cl_alloca(N*sizeof(cl_pqd_series_term));
-       var uintL n;
+       var uintC n;
        for (n = 0; n < N; n++) {
                init1(cl_I, args[n].p) (2*(cl_I)(N-n)*(cl_I)(N+n));
                init1(cl_I, args[n].q) ((cl_I)(2*n+1)*(cl_I)(n+1));
index a5c9cabe1894c21c75024b231b86d73e98c30586..ee68f827c23396f0a9cc8d4a5238a6f8dbdb8715 100644 (file)
@@ -26,15 +26,15 @@ namespace cln {
 // by a power series evaluation brings 20% speedup, even more for small lengths.
 #define TRIVIAL_SPEEDUP
 
-const cl_LF_cosh_sinh_t cl_coshsinh_aux (const cl_I& p, uintL lq, uintC len)
+const cl_LF_cosh_sinh_t cl_coshsinh_aux (const cl_I& p, uintC lq, uintC len)
 {
  {     Mutable(cl_I,p);
-       var uintL lp = integer_length(p); // now |p| < 2^lp.
+       var uintC lp = integer_length(p); // now |p| < 2^lp.
        if (!(lp <= lq)) cl_abort();
        lp = lq - lp; // now |p/2^lq| < 2^-lp.
        // Minimize lq (saves computation time).
        {
-               var uintL lp2 = ord2(p);
+               var uintC lp2 = ord2(p);
                if (lp2 > 0) {
                        p = p >> lp2;
                        lq = lq - lp2;
@@ -65,16 +65,16 @@ const cl_LF_cosh_sinh_t cl_coshsinh_aux (const cl_I& p, uintL lq, uintC len)
        // Third approximation:
        //   N2 = ceiling(M*log(2)/(log(N1)-1+lp*log(2))), slightly too large.
        //   N = N2+2, two more terms for safety.
-       var uintL N0 = intDsize*actuallen;
-       var uintL N1 = (uintL)(0.693147*intDsize*actuallen/(::log((double)N0)-1.0+0.693148*lp));
-       var uintL N2 = (uintL)(0.693148*intDsize*actuallen/(::log((double)N1)-1.0+0.693147*lp))+1;
-       var uintL N = N2+2;
+       var uintC N0 = intDsize*actuallen;
+       var uintC N1 = (uintC)(0.693147*intDsize*actuallen/(::log((double)N0)-1.0+0.693148*lp));
+       var uintC N2 = (uintC)(0.693148*intDsize*actuallen/(::log((double)N1)-1.0+0.693147*lp))+1;
+       var uintC N = N2+2;
        N = ceiling(N,2);
        CL_ALLOCA_STACK;
        var cl_I* pv = (cl_I*) cl_alloca(N*sizeof(cl_I));
        var cl_I* qv = (cl_I*) cl_alloca(N*sizeof(cl_I));
-       var uintL* qsv = (uintL*) cl_alloca(N*sizeof(uintL));
-       var uintL n;
+       var uintC* qsv = (uintC*) cl_alloca(N*sizeof(uintC));
+       var uintC n;
        var cl_I p2 = square(p);
        var cl_LF sinhsum;
        {
index 5e3e0b3a64b39e4c75483dd867c0efaab795635c..32d0b77e85aff2573ef8be642e1c6694ba822567 100644 (file)
@@ -26,15 +26,15 @@ namespace cln {
 // by a power series evaluation brings 20% speedup, even more for small lengths.
 #define TRIVIAL_SPEEDUP
 
-const cl_LF_cos_sin_t cl_cossin_aux (const cl_I& p, uintL lq, uintC len)
+const cl_LF_cos_sin_t cl_cossin_aux (const cl_I& p, uintC lq, uintC len)
 {
  {     Mutable(cl_I,p);
-       var uintL lp = integer_length(p); // now |p| < 2^lp.
+       var uintC lp = integer_length(p); // now |p| < 2^lp.
        if (!(lp <= lq)) cl_abort();
        lp = lq - lp; // now |p/2^lq| < 2^-lp.
        // Minimize lq (saves computation time).
        {
-               var uintL lp2 = ord2(p);
+               var uintC lp2 = ord2(p);
                if (lp2 > 0) {
                        p = p >> lp2;
                        lq = lq - lp2;
@@ -65,16 +65,16 @@ const cl_LF_cos_sin_t cl_cossin_aux (const cl_I& p, uintL lq, uintC len)
        // Third approximation:
        //   N2 = ceiling(M*log(2)/(log(N1)-1+lp*log(2))), slightly too large.
        //   N = N2+2, two more terms for safety.
-       var uintL N0 = intDsize*actuallen;
-       var uintL N1 = (uintL)(0.693147*intDsize*actuallen/(::log((double)N0)-1.0+0.693148*lp));
-       var uintL N2 = (uintL)(0.693148*intDsize*actuallen/(::log((double)N1)-1.0+0.693147*lp))+1;
-       var uintL N = N2+2;
+       var uintC N0 = intDsize*actuallen;
+       var uintC N1 = (uintC)(0.693147*intDsize*actuallen/(::log((double)N0)-1.0+0.693148*lp));
+       var uintC N2 = (uintC)(0.693148*intDsize*actuallen/(::log((double)N1)-1.0+0.693147*lp))+1;
+       var uintC N = N2+2;
        N = ceiling(N,2);
        CL_ALLOCA_STACK;
        var cl_I* pv = (cl_I*) cl_alloca(N*sizeof(cl_I));
        var cl_I* qv = (cl_I*) cl_alloca(N*sizeof(cl_I));
-       var uintL* qsv = (uintL*) cl_alloca(N*sizeof(uintL));
-       var uintL n;
+       var uintC* qsv = (uintC*) cl_alloca(N*sizeof(uintC));
+       var uintC n;
        var cl_I p2 = -square(p);
        var cl_LF sinsum;
        {
index 9738f48e725a01744f79e94de6142c9296b501eb..3ab99de444e9cd21570cda1466cefcddd99402ba 100644 (file)
@@ -72,13 +72,13 @@ const cl_LF compute_eulerconst_expintegral (uintC len)
        // to more than double the floating-point precision because of the large
        // extinction which takes place. But luckily we compute with integers.
        var uintC actuallen = len+1; // 1 Schutz-Digit
-       var uintL z = (uintL)(0.693148*intDsize*actuallen)+1;
-       var uintL N = (uintL)(3.591121477*z);
+       var uintC z = (uintC)(0.693148*intDsize*actuallen)+1;
+       var uintC N = (uintC)(3.591121477*z);
        CL_ALLOCA_STACK;
        var cl_I* bv = (cl_I*) cl_alloca(N*sizeof(cl_I));
        var cl_I* pv = (cl_I*) cl_alloca(N*sizeof(cl_I));
        var cl_I* qv = (cl_I*) cl_alloca(N*sizeof(cl_I));
-       var uintL n;
+       var uintC n;
        for (n = 0; n < N; n++) {
                init1(cl_I, bv[n]) (n+1);
                init1(cl_I, pv[n]) (n==0 ? (cl_I)z : -(cl_I)z);
@@ -147,14 +147,14 @@ const cl_LF compute_eulerconst_expintegral1 (uintC len)
        // each.
        // We compute f(x) classically and g(x) using the partial sums of f(x).
        var uintC actuallen = len+2; // 2 Schutz-Digits
-       var uintL x = (uintL)(0.693148*intDsize*actuallen)+1;
-       var uintL N = (uintL)(2.718281828*x);
+       var uintC x = (uintC)(0.693148*intDsize*actuallen)+1;
+       var uintC N = (uintC)(2.718281828*x);
        var cl_LF one = cl_I_to_LF(1,actuallen);
        var cl_LF fterm = one;
        var cl_LF fsum = fterm;
        var cl_LF gterm = cl_I_to_LF(0,actuallen);
        var cl_LF gsum = gterm;
-       var uintL n;
+       var uintC n;
        // After n loops
        //   fterm = x^n/n!, fsum = 1 + x/1! + ... + x^n/n!,
        //   gterm = H_n*x^n/n!, gsum = H_1*x/1! + ... + H_n*x^n/n!.
@@ -187,11 +187,11 @@ const cl_LF compute_eulerconst_expintegral1 (uintC len)
 const cl_LF compute_eulerconst_expintegral2 (uintC len)
 {
        var uintC actuallen = len+2; // 2 Schutz-Digits
-       var uintL x = (uintL)(0.693148*intDsize*actuallen)+1;
-       var uintL N = (uintL)(2.718281828*x);
+       var uintC x = (uintC)(0.693148*intDsize*actuallen)+1;
+       var uintC N = (uintC)(2.718281828*x);
        CL_ALLOCA_STACK;
        var cl_pqd_series_term* args = (cl_pqd_series_term*) cl_alloca(N*sizeof(cl_pqd_series_term));
-       var uintL n;
+       var uintC n;
        for (n = 0; n < N; n++) {
                init1(cl_I, args[n].p) (x);
                init1(cl_I, args[n].q) (n+1);
@@ -277,15 +277,15 @@ const cl_LF compute_eulerconst_besselintegral1 (uintC len)
 {
        // We compute f(x) classically and g(x) using the partial sums of f(x).
        var uintC actuallen = len+1; // 1 Schutz-Digit
-       var uintL sx = (uintL)(0.25*0.693148*intDsize*actuallen)+1;
-       var uintL N = (uintL)(3.591121477*sx);
+       var uintC sx = (uintC)(0.25*0.693148*intDsize*actuallen)+1;
+       var uintC N = (uintC)(3.591121477*sx);
        var cl_I x = square((cl_I)sx);
-       var cl_LF eps = scale_float(cl_I_to_LF(1,LF_minlen),-(sintL)(sx*2.88539+10));
+       var cl_LF eps = scale_float(cl_I_to_LF(1,LF_minlen),-(sintC)(sx*2.88539+10));
        var cl_LF fterm = cl_I_to_LF(1,actuallen);
        var cl_LF fsum = fterm;
        var cl_LF gterm = cl_I_to_LF(0,actuallen);
        var cl_LF gsum = gterm;
-       var uintL n;
+       var uintC n;
        // After n loops
        //   fterm = x^n/n!^2, fsum = 1 + x/1!^2 + ... + x^n/n!^2,
        //   gterm = H_n*x^n/n!^2, gsum = H_1*x/1!^2 + ... + H_n*x^n/n!^2.
@@ -327,14 +327,14 @@ const cl_LF compute_eulerconst_besselintegral2 (uintC len)
        // (Because HD_n grows like exp(n), hence HN_n grows like exp(n) as
        // well, and we store all HN_n values in an array!)
        var uintC actuallen = len+1; // 1 Schutz-Digit
-       var uintL sx = (uintL)(0.25*0.693148*intDsize*actuallen)+1;
-       var uintL N = (uintL)(3.591121477*sx);
+       var uintC sx = (uintC)(0.25*0.693148*intDsize*actuallen)+1;
+       var uintC N = (uintC)(3.591121477*sx);
        var cl_I x = square((cl_I)sx);
        CL_ALLOCA_STACK;
        var cl_I* av = (cl_I*) cl_alloca(N*sizeof(cl_I));
        var cl_I* pv = (cl_I*) cl_alloca(N*sizeof(cl_I));
        var cl_I* qv = (cl_I*) cl_alloca(N*sizeof(cl_I));
-       var uintL n;
+       var uintC n;
        // Evaluate f(x).
        init1(cl_I, pv[0]) (1);
        init1(cl_I, qv[0]) (1);
@@ -409,13 +409,13 @@ struct cl_rational_series_for_g : cl_pqa_series_stream {
 const cl_LF compute_eulerconst_besselintegral3 (uintC len)
 {
        var uintC actuallen = len+1; // 1 Schutz-Digit
-       var uintL sx = (uintL)(0.25*0.693148*intDsize*actuallen)+1;
-       var uintL N = (uintL)(3.591121477*sx);
+       var uintC sx = (uintC)(0.25*0.693148*intDsize*actuallen)+1;
+       var uintC N = (uintC)(3.591121477*sx);
        var cl_I x = square((cl_I)sx);
        CL_ALLOCA_STACK;
        var cl_I* pv = (cl_I*) cl_alloca(N*sizeof(cl_I));
        var cl_I* qv = (cl_I*) cl_alloca(N*sizeof(cl_I));
-       var uintL n;
+       var uintC n;
        // Evaluate f(x).
        init1(cl_I, pv[0]) (1);
        init1(cl_I, qv[0]) (1);
@@ -445,12 +445,12 @@ const cl_LF compute_eulerconst_besselintegral3 (uintC len)
 const cl_LF compute_eulerconst_besselintegral4 (uintC len)
 {
        var uintC actuallen = len+2; // 2 Schutz-Digits
-       var uintL sx = (uintL)(0.25*0.693148*intDsize*actuallen)+1;
-       var uintL N = (uintL)(3.591121477*sx);
+       var uintC sx = (uintC)(0.25*0.693148*intDsize*actuallen)+1;
+       var uintC N = (uintC)(3.591121477*sx);
        var cl_I x = square((cl_I)sx);
        CL_ALLOCA_STACK;
        var cl_pqd_series_term* args = (cl_pqd_series_term*) cl_alloca(N*sizeof(cl_pqd_series_term));
-       var uintL n;
+       var uintC n;
        for (n = 0; n < N; n++) {
                init1(cl_I, args[n].p) (x);
                init1(cl_I, args[n].q) (square((cl_I)(n+1)));
index 713e2dde2c8f86e0f27b1605b13bbbaa6ac8563c..f8827f8e26fa8b663d510e9717332bbf249e9cc1 100644 (file)
@@ -38,14 +38,14 @@ const cl_LF compute_exp1 (uintC len)
        // Third approximation:
        //   N2 = ceiling(M*log(2)/(log(N1)-1)), slightly too large.
        //   N = N2+2, two more terms for safety.
-       var uintL N0 = intDsize*actuallen;
-       var uintL N1 = (uintL)(0.693147*intDsize*actuallen/(::log((double)N0)-1.0));
-       var uintL N2 = (uintL)(0.693148*intDsize*actuallen/(::log((double)N1)-1.0))+1;
-       var uintL N = N2+2;
+       var uintC N0 = intDsize*actuallen;
+       var uintC N1 = (uintC)(0.693147*intDsize*actuallen/(::log((double)N0)-1.0));
+       var uintC N2 = (uintC)(0.693148*intDsize*actuallen/(::log((double)N1)-1.0))+1;
+       var uintC N = N2+2;
        CL_ALLOCA_STACK;
        var cl_I* qv = (cl_I*) cl_alloca(N*sizeof(cl_I));
-       var uintL* qsv = (uintL*) cl_alloca(N*sizeof(uintL));
-       var uintL n;
+       var uintC* qsv = (uintC*) cl_alloca(N*sizeof(uintC));
+       var uintC n;
        for (n = 0; n < N; n++) {
                init1(cl_I, qv[n]) (n==0 ? 1 : n);
        }
index a0dfc3c5a116b9243ab597df7cfbe62ab013e615..1dda6d28d49019d3a22fe1a2ad8a6a1f4eb48801 100644 (file)
 
 namespace cln {
 
-const cl_LF cl_exp_aux (const cl_I& p, uintL lq, uintC len)
+const cl_LF cl_exp_aux (const cl_I& p, uintC lq, uintC len)
 {
  {     Mutable(cl_I,p);
-       var uintL lp = integer_length(p); // now |p| < 2^lp.
+       var uintC lp = integer_length(p); // now |p| < 2^lp.
        if (!(lp <= lq)) cl_abort();
        lp = lq - lp; // now |p/2^lq| < 2^-lp.
        // Minimize lq (saves computation time).
        {
-               var uintL lp2 = ord2(p);
+               var uintC lp2 = ord2(p);
                if (lp2 > 0) {
                        p = p >> lp2;
                        lq = lq - lp2;
@@ -52,15 +52,15 @@ const cl_LF cl_exp_aux (const cl_I& p, uintL lq, uintC len)
        // Third approximation:
        //   N2 = ceiling(M*log(2)/(log(N1)-1+lp*log(2))), slightly too large.
        //   N = N2+2, two more terms for safety.
-       var uintL N0 = intDsize*actuallen;
-       var uintL N1 = (uintL)(0.693147*intDsize*actuallen/(::log((double)N0)-1.0+0.693148*lp));
-       var uintL N2 = (uintL)(0.693148*intDsize*actuallen/(::log((double)N1)-1.0+0.693147*lp))+1;
-       var uintL N = N2+2;
+       var uintC N0 = intDsize*actuallen;
+       var uintC N1 = (uintC)(0.693147*intDsize*actuallen/(::log((double)N0)-1.0+0.693148*lp));
+       var uintC N2 = (uintC)(0.693148*intDsize*actuallen/(::log((double)N1)-1.0+0.693147*lp))+1;
+       var uintC N = N2+2;
        CL_ALLOCA_STACK;
        var cl_I* pv = (cl_I*) cl_alloca(N*sizeof(cl_I));
        var cl_I* qv = (cl_I*) cl_alloca(N*sizeof(cl_I));
-       var uintL* qsv = (uintL*) cl_alloca(N*sizeof(uintL));
-       var uintL n;
+       var uintC* qsv = (uintC*) cl_alloca(N*sizeof(uintC));
+       var uintC n;
        init1(cl_I, pv[0]) (1);
        init1(cl_I, qv[0]) (1);
        for (n = 1; n < N; n++) {
index 284ad1a638ab6679f217721e22ef18a1e52c6520..311ce3be9603a0c551da6b2074678612747c7993 100644 (file)
@@ -62,7 +62,7 @@ const cl_LF compute_pi_brent_salamin (uintC len)
        //   (/ (expt a 2) t)
        // )
        var uintC actuallen = len + 1; // 1 Schutz-Digit
-       var uintL uexp_limit = LF_exp_mid - intDsize*(uintL)len;
+       var uintC uexp_limit = LF_exp_mid - intDsize*len;
        // Ein Long-Float ist genau dann betragsmäßig <2^-n, wenn
        // sein Exponent < LF_exp_mid-n = uexp_limit ist.
        var cl_LF a = cl_I_to_LF(1,actuallen);
@@ -112,7 +112,7 @@ const cl_LF compute_pi_brent_salamin_quartic (uintC len)
        // Hence,
        //   pi = AGM(1,1/sqrt(2))^2 * 1/(1/2 - sum(k even, 2^k*[....])).
        var uintC actuallen = len + 1; // 1 Schutz-Digit
-       var uintL uexp_limit = LF_exp_mid - intDsize*(uintL)len;
+       var uintC uexp_limit = LF_exp_mid - intDsize*len;
        var cl_LF one = cl_I_to_LF(1,actuallen);
        var cl_LF a = one;
        var cl_LF wa = one;
@@ -154,8 +154,8 @@ const cl_LF compute_pi_ramanujan_163 (uintC len)
        // in precision.
        // The sum is best evaluated using fixed-point arithmetic,
        // so that the precision is reduced for the later summands.
-       var uintL actuallen = len + 4; // 4 Schutz-Digits
-       var sintL scale = intDsize*actuallen;
+       var uintC actuallen = len + 4; // 4 Schutz-Digits
+       var sintC scale = intDsize*actuallen;
        static const cl_I A = "163096908";
        static const cl_I B = "6541681608";
        //static const cl_I J1 = "10939058860032000"; // 72*abs(J)
@@ -191,7 +191,7 @@ const cl_LF compute_pi_ramanujan_163_fast (uintC len)
 {
        // Same formula as above, using a binary splitting evaluation.
        // See [Borwein, Borwein, section 10.2.3].
-       var uintL actuallen = len + 4; // 4 Schutz-Digits
+       var uintC actuallen = len + 4; // 4 Schutz-Digits
        static const cl_I A = "163096908";
        static const cl_I B = "6541681608";
        static const cl_I J1 = "10939058860032000"; // 72*abs(J)
@@ -200,17 +200,17 @@ const cl_LF compute_pi_ramanujan_163_fast (uintC len)
        //   a(n) = A+n*B, b(n) = 1,
        //   p(n) = -(6n-5)(2n-1)(6n-1) for n>0,
        //   q(n) = 72*|J|*n^3 for n>0.
-       var const uintL n_slope = (uintL)(intDsize*32*0.02122673)+1;
+       var const uintC n_slope = (uintC)(intDsize*32*0.02122673)+1;
        // n_slope >= 32*intDsize*log(2)/log(|J|), normally n_slope = 22.
-       var uintL N = (n_slope*actuallen)/32 + 1;
+       var uintC N = (n_slope*actuallen)/32 + 1;
        // N > intDsize*log(2)/log(|J|) * actuallen, hence
        // |J|^-N < 2^(-intDsize*actuallen).
        CL_ALLOCA_STACK;
        var cl_I* av = (cl_I*) cl_alloca(N*sizeof(cl_I));
        var cl_I* pv = (cl_I*) cl_alloca(N*sizeof(cl_I));
        var cl_I* qv = (cl_I*) cl_alloca(N*sizeof(cl_I));
-       var uintL* qsv = (uintL*) cl_alloca(N*sizeof(uintL));
-       var uintL n;
+       var uintC* qsv = (uintC*) cl_alloca(N*sizeof(uintC));
+       var uintC n;
        for (n = 0; n < N; n++) {
                init1(cl_I, av[n]) (A+n*B);
                if (n==0) {
index 5e15e6195c63b054ba064944c57f31c614eff7f7..7dbcbc8b323e3b68477d2391467a664096796c7c 100644 (file)
@@ -17,7 +17,7 @@ namespace cln {
 // and T = B*Q*S (all integers). On entry N1 < N2.
 // P will not be computed if a NULL pointer is passed.
 
-const cl_LF eval_rational_series (uintL N, const cl_rational_series& args, uintC len)
+const cl_LF eval_rational_series (uintC N, const cl_rational_series& args, uintC len)
 {
        if (args.pv)
                if (args.qv)
index c08135f2a444372ab93fbff1c54c3b167211068d..537ea157ed7575a0ba9cd058f890384b57340772 100644 (file)
@@ -22,7 +22,7 @@ namespace cln {
 // and T = B*Q*S (all integers). On entry N1 < N2.
 // P will not be computed if a NULL pointer is passed.
 
-static inline void eval__series_aux (uintL N1, uintL N2,
+static inline void eval__series_aux (uintC N1, uintC N2,
                                      const cl__series& args,
                                      cl_I* T)
 {
@@ -30,7 +30,7 @@ static inline void eval__series_aux (uintL N1, uintL N2,
        *T = N2-N1;
 }
 
-const cl_LF eval_rational_series (uintL N, const cl__series& args, uintC len)
+const cl_LF eval_rational_series (uintC N, const cl__series& args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
index 1b467c7e81c39797e768222d0d8a0eee75b88ecc..b8338dabd30196bdb84f7f146163077dbb6782dc 100644 (file)
@@ -22,7 +22,7 @@ namespace cln {
 // and T = B*Q*S (all integers). On entry N1 < N2.
 // P will not be computed if a NULL pointer is passed.
 
-static void eval_a_series_aux (uintL N1, uintL N2,
+static void eval_a_series_aux (uintC N1, uintC N2,
                                const cl_a_series& args,
                                cl_I* T)
 {
@@ -51,7 +51,7 @@ static void eval_a_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LT;
                eval_a_series_aux(N1,Nm,args,&LT);
@@ -66,7 +66,7 @@ static void eval_a_series_aux (uintL N1, uintL N2,
        }
 }
 
-const cl_LF eval_rational_series (uintL N, const cl_a_series& args, uintC len)
+const cl_LF eval_rational_series (uintC N, const cl_a_series& args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
index e1544f12c5176e9d036cc6fff622aeb49120e5b5..e5f50fb1881c0479c8fbbbbaffb733de89b0660e 100644 (file)
@@ -22,7 +22,7 @@ namespace cln {
 // and T = B*Q*S (all integers). On entry N1 < N2.
 // P will not be computed if a NULL pointer is passed.
 
-static void eval_ab_series_aux (uintL N1, uintL N2,
+static void eval_ab_series_aux (uintC N1, uintC N2,
                                 const cl_ab_series& args,
                                 cl_I* B, cl_I* T)
 {
@@ -58,7 +58,7 @@ static void eval_ab_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LB, LT;
                eval_ab_series_aux(N1,Nm,args,&LB,&LT);
@@ -74,7 +74,7 @@ static void eval_ab_series_aux (uintL N1, uintL N2,
        }
 }
 
-const cl_LF eval_rational_series (uintL N, const cl_ab_series& args, uintC len)
+const cl_LF eval_rational_series (uintC N, const cl_ab_series& args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
index 05323614a7e601847b43117d392ed2bb4ae1e672..5c3ce3c9addd7f67a45a7e9348239cbd2ebf6d69 100644 (file)
@@ -22,7 +22,7 @@ namespace cln {
 // and T = B*Q*S (all integers). On entry N1 < N2.
 // P will not be computed if a NULL pointer is passed.
 
-static void eval_b_series_aux (uintL N1, uintL N2,
+static void eval_b_series_aux (uintC N1, uintC N2,
                                const cl_b_series& args,
                                cl_I* B, cl_I* T)
 {
@@ -58,7 +58,7 @@ static void eval_b_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LB, LT;
                eval_b_series_aux(N1,Nm,args,&LB,&LT);
@@ -74,7 +74,7 @@ static void eval_b_series_aux (uintL N1, uintL N2,
        }
 }
 
-const cl_LF eval_rational_series (uintL N, const cl_b_series& args, uintC len)
+const cl_LF eval_rational_series (uintC N, const cl_b_series& args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
index ce9130fa386439c91c24bf5aa1b415b488a63d46..65ef9b5eb8ec4844292c9a7575eb161ea473a9e6 100644 (file)
@@ -22,7 +22,7 @@ namespace cln {
 // and T = B*Q*S (all integers). On entry N1 < N2.
 // P will not be computed if a NULL pointer is passed.
 
-static void eval_p_series_aux (uintL N1, uintL N2,
+static void eval_p_series_aux (uintC N1, uintC N2,
                                const cl_p_series& args,
                                cl_I* P, cl_I* T)
 {
@@ -61,7 +61,7 @@ static void eval_p_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LP, LT;
                eval_p_series_aux(N1,Nm,args,&LP,&LT);
@@ -77,7 +77,7 @@ static void eval_p_series_aux (uintL N1, uintL N2,
        }
 }
 
-const cl_LF eval_rational_series (uintL N, const cl_p_series& args, uintC len)
+const cl_LF eval_rational_series (uintC N, const cl_p_series& args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
index 74f8b81ecf5bcdd97ce058fbe61eb4e6c8eb84f7..6382f8404f16669e0f4c0bb331de19ab78359ff1 100644 (file)
@@ -22,7 +22,7 @@ namespace cln {
 // and T = B*Q*S (all integers). On entry N1 < N2.
 // P will not be computed if a NULL pointer is passed.
 
-static void eval_pa_series_aux (uintL N1, uintL N2,
+static void eval_pa_series_aux (uintC N1, uintC N2,
                                 const cl_pa_series& args,
                                 cl_I* P, cl_I* T)
 {
@@ -61,7 +61,7 @@ static void eval_pa_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LP, LT;
                eval_pa_series_aux(N1,Nm,args,&LP,&LT);
@@ -77,7 +77,7 @@ static void eval_pa_series_aux (uintL N1, uintL N2,
        }
 }
 
-const cl_LF eval_rational_series (uintL N, const cl_pa_series& args, uintC len)
+const cl_LF eval_rational_series (uintC N, const cl_pa_series& args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
index cfec8d149e78b5764e07cf00de64997c8bacfa56..ee97f0652574dc1bfdaee3afea767c66102636a7 100644 (file)
@@ -22,7 +22,7 @@ namespace cln {
 // and T = B*Q*S (all integers). On entry N1 < N2.
 // P will not be computed if a NULL pointer is passed.
 
-static void eval_pab_series_aux (uintL N1, uintL N2,
+static void eval_pab_series_aux (uintC N1, uintC N2,
                                  const cl_pab_series& args,
                                  cl_I* P, cl_I* B, cl_I* T)
 {
@@ -68,7 +68,7 @@ static void eval_pab_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LP, LB, LT;
                eval_pab_series_aux(N1,Nm,args,&LP,&LB,&LT);
@@ -85,7 +85,7 @@ static void eval_pab_series_aux (uintL N1, uintL N2,
        }
 }
 
-const cl_LF eval_rational_series (uintL N, const cl_pab_series& args, uintC len)
+const cl_LF eval_rational_series (uintC N, const cl_pab_series& args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
index 9ddf079fbbd3afaa1b12fc9ff45c5c5dd3dd43e2..eedd587a4d39c652e37640619881c9ffb9adb1c1 100644 (file)
@@ -22,7 +22,7 @@ namespace cln {
 // and T = B*Q*S (all integers). On entry N1 < N2.
 // P will not be computed if a NULL pointer is passed.
 
-static void eval_pb_series_aux (uintL N1, uintL N2,
+static void eval_pb_series_aux (uintC N1, uintC N2,
                                 const cl_pb_series& args,
                                 cl_I* P, cl_I* B, cl_I* T)
 {
@@ -68,7 +68,7 @@ static void eval_pb_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LP, LB, LT;
                eval_pb_series_aux(N1,Nm,args,&LP,&LB,&LT);
@@ -85,7 +85,7 @@ static void eval_pb_series_aux (uintL N1, uintL N2,
        }
 }
 
-const cl_LF eval_rational_series (uintL N, const cl_pb_series& args, uintC len)
+const cl_LF eval_rational_series (uintC N, const cl_pb_series& args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
index a5eb904535c0f285a37f9a9b0222bca07ecb614b..ce90e8b2f863d0eafa830ce971a9ffdbca2655b5 100644 (file)
@@ -22,7 +22,7 @@ namespace cln {
 // and T = B*Q*S (all integers). On entry N1 < N2.
 // P will not be computed if a NULL pointer is passed.
 
-static void eval_pq_series_aux (uintL N1, uintL N2,
+static void eval_pq_series_aux (uintC N1, uintC N2,
                                 const cl_pq_series& args,
                                 cl_I* P, cl_I* Q, cl_I* T)
 {
@@ -68,7 +68,7 @@ static void eval_pq_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LP, LQ, LT;
                eval_pq_series_aux(N1,Nm,args,&LP,&LQ,&LT);
@@ -85,9 +85,9 @@ static void eval_pq_series_aux (uintL N1, uintL N2,
        }
 }
 
-static void eval_pqs_series_aux (uintL N1, uintL N2,
+static void eval_pqs_series_aux (uintC N1, uintC N2,
                                  const cl_pq_series& args,
-                                 cl_I* P, cl_I* Q, uintL* QS, cl_I* T)
+                                 cl_I* P, cl_I* Q, uintC* QS, cl_I* T)
 {
        switch (N2 - N1) {
        case 0:
@@ -135,14 +135,14 @@ static void eval_pqs_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LP, LQ, LT;
-               var uintL LQS;
+               var uintC LQS;
                eval_pqs_series_aux(N1,Nm,args,&LP,&LQ,&LQS,&LT);
                // Compute right part.
                var cl_I RP, RQ, RT;
-               var uintL RQS;
+               var uintC RQS;
                eval_pqs_series_aux(Nm,N2,args,(P?&RP:(cl_I*)0),&RQ,&RQS,&RT);
                // Put together partial results.
                if (P) { *P = LP*RP; }
@@ -155,7 +155,7 @@ static void eval_pqs_series_aux (uintL N1, uintL N2,
        }
 }
 
-const cl_LF eval_rational_series (uintL N, const cl_pq_series& args, uintC len)
+const cl_LF eval_rational_series (uintC N, const cl_pq_series& args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
@@ -168,10 +168,10 @@ const cl_LF eval_rational_series (uintL N, const cl_pq_series& args, uintC len)
                // Split qv[n] into qv[n]*2^qsv[n].
                {
                        var cl_I* qp = args.qv;
-                       var uintL* qsp = args.qsv;
-                       for (var uintL n = 0; n < N; n++, qp++, qsp++) {
+                       var uintC* qsp = args.qsv;
+                       for (var uintC n = 0; n < N; n++, qp++, qsp++) {
                                // Pull out maximal power of 2 out of *qp = args.qv[n].
-                               var uintL qs = 0;
+                               var uintC qs = 0;
                                if (!zerop(*qp)) {
                                        qs = ord2(*qp);
                                        if (qs > 0)
@@ -181,7 +181,7 @@ const cl_LF eval_rational_series (uintL N, const cl_pq_series& args, uintC len)
                        }
                }
                // Main computation.
-               var uintL QS;
+               var uintC QS;
                eval_pqs_series_aux(0,N,args,NULL,&Q,&QS,&T);
                return cl_I_to_LF(T,len) / scale_float(cl_I_to_LF(Q,len),QS);
        }
index 05aa7432a8cdfb2478c3e3ed2f6e2e4b86dabe86..95c6e03d9ea41da394d07cbe93f6351ff55a45cc 100644 (file)
@@ -22,7 +22,7 @@ namespace cln {
 // and T = B*Q*S (all integers). On entry N1 < N2.
 // P will not be computed if a NULL pointer is passed.
 
-static void eval_pqa_series_aux (uintL N1, uintL N2,
+static void eval_pqa_series_aux (uintC N1, uintC N2,
                                  const cl_pqa_series& args,
                                  cl_I* P, cl_I* Q, cl_I* T)
 {
@@ -68,7 +68,7 @@ static void eval_pqa_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LP, LQ, LT;
                eval_pqa_series_aux(N1,Nm,args,&LP,&LQ,&LT);
@@ -85,9 +85,9 @@ static void eval_pqa_series_aux (uintL N1, uintL N2,
        }
 }
 
-static void eval_pqsa_series_aux (uintL N1, uintL N2,
+static void eval_pqsa_series_aux (uintC N1, uintC N2,
                                   const cl_pqa_series& args,
-                                  cl_I* P, cl_I* Q, uintL* QS, cl_I* T)
+                                  cl_I* P, cl_I* Q, uintC* QS, cl_I* T)
 {
        switch (N2 - N1) {
        case 0:
@@ -135,14 +135,14 @@ static void eval_pqsa_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LP, LQ, LT;
-               var uintL LQS;
+               var uintC LQS;
                eval_pqsa_series_aux(N1,Nm,args,&LP,&LQ,&LQS,&LT);
                // Compute right part.
                var cl_I RP, RQ, RT;
-               var uintL RQS;
+               var uintC RQS;
                eval_pqsa_series_aux(Nm,N2,args,(P?&RP:(cl_I*)0),&RQ,&RQS,&RT);
                // Put together partial results.
                if (P) { *P = LP*RP; }
@@ -155,7 +155,7 @@ static void eval_pqsa_series_aux (uintL N1, uintL N2,
        }
 }
 
-const cl_LF eval_rational_series (uintL N, const cl_pqa_series& args, uintC len)
+const cl_LF eval_rational_series (uintC N, const cl_pqa_series& args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
@@ -168,10 +168,10 @@ const cl_LF eval_rational_series (uintL N, const cl_pqa_series& args, uintC len)
                // Split qv[n] into qv[n]*2^qsv[n].
                {
                        var cl_I* qp = args.qv;
-                       var uintL* qsp = args.qsv;
-                       for (var uintL n = 0; n < N; n++, qp++, qsp++) {
+                       var uintC* qsp = args.qsv;
+                       for (var uintC n = 0; n < N; n++, qp++, qsp++) {
                                // Pull out maximal power of 2 out of *qp = args.qv[n].
-                               var uintL qs = 0;
+                               var uintC qs = 0;
                                if (!zerop(*qp)) {
                                        qs = ord2(*qp);
                                        if (qs > 0)
@@ -181,7 +181,7 @@ const cl_LF eval_rational_series (uintL N, const cl_pqa_series& args, uintC len)
                        }
                }
                // Main computation.
-               var uintL QS;
+               var uintC QS;
                eval_pqsa_series_aux(0,N,args,NULL,&Q,&QS,&T);
                return cl_I_to_LF(T,len) / scale_float(cl_I_to_LF(Q,len),QS);
        }
index 46808938de46fd35e2768505fe93659402650e34..1d9ef3e511814eb64d323bbcdf63b128f81455de 100644 (file)
@@ -22,7 +22,7 @@ namespace cln {
 // and T = B*Q*S (all integers). On entry N1 < N2.
 // P will not be computed if a NULL pointer is passed.
 
-static void eval_pqab_series_aux (uintL N1, uintL N2,
+static void eval_pqab_series_aux (uintC N1, uintC N2,
                                   const cl_pqab_series& args,
                                   cl_I* P, cl_I* Q, cl_I* B, cl_I* T)
 {
@@ -75,7 +75,7 @@ static void eval_pqab_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LP, LQ, LB, LT;
                eval_pqab_series_aux(N1,Nm,args,&LP,&LQ,&LB,&LT);
@@ -93,9 +93,9 @@ static void eval_pqab_series_aux (uintL N1, uintL N2,
        }
 }
 
-static void eval_pqsab_series_aux (uintL N1, uintL N2,
+static void eval_pqsab_series_aux (uintC N1, uintC N2,
                                    const cl_pqab_series& args,
-                                   cl_I* P, cl_I* Q, uintL* QS, cl_I* B, cl_I* T)
+                                   cl_I* P, cl_I* Q, uintC* QS, cl_I* B, cl_I* T)
 {
        switch (N2 - N1) {
        case 0:
@@ -150,14 +150,14 @@ static void eval_pqsab_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LP, LQ, LB, LT;
-               var uintL LQS;
+               var uintC LQS;
                eval_pqsab_series_aux(N1,Nm,args,&LP,&LQ,&LQS,&LB,&LT);
                // Compute right part.
                var cl_I RP, RQ, RB, RT;
-               var uintL RQS;
+               var uintC RQS;
                eval_pqsab_series_aux(Nm,N2,args,(P?&RP:(cl_I*)0),&RQ,&RQS,&RB,&RT);
                // Put together partial results.
                if (P) { *P = LP*RP; }
@@ -171,7 +171,7 @@ static void eval_pqsab_series_aux (uintL N1, uintL N2,
        }
 }
 
-const cl_LF eval_rational_series (uintL N, const cl_pqab_series& args, uintC len)
+const cl_LF eval_rational_series (uintC N, const cl_pqab_series& args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
@@ -184,10 +184,10 @@ const cl_LF eval_rational_series (uintL N, const cl_pqab_series& args, uintC len
                // Split qv[n] into qv[n]*2^qsv[n].
                {
                        var cl_I* qp = args.qv;
-                       var uintL* qsp = args.qsv;
-                       for (var uintL n = 0; n < N; n++, qp++, qsp++) {
+                       var uintC* qsp = args.qsv;
+                       for (var uintC n = 0; n < N; n++, qp++, qsp++) {
                                // Pull out maximal power of 2 out of *qp = args.qv[n].
-                               var uintL qs = 0;
+                               var uintC qs = 0;
                                if (!zerop(*qp)) {
                                        qs = ord2(*qp);
                                        if (qs > 0)
@@ -197,7 +197,7 @@ const cl_LF eval_rational_series (uintL N, const cl_pqab_series& args, uintC len
                        }
                }
                // Main computation.
-               var uintL QS;
+               var uintC QS;
                eval_pqsab_series_aux(0,N,args,NULL,&Q,&QS,&B,&T);
                return cl_I_to_LF(T,len) / scale_float(cl_I_to_LF(B*Q,len),QS);
        }
index cee4716f0d8a9ffbe12bf830b38075f3eb39470e..69cf1d2e45bc72208410d5fbd5dc55e1aa39ccd2 100644 (file)
@@ -22,7 +22,7 @@ namespace cln {
 // and T = B*Q*S (all integers). On entry N1 < N2.
 // P will not be computed if a NULL pointer is passed.
 
-static void eval_pqb_series_aux (uintL N1, uintL N2,
+static void eval_pqb_series_aux (uintC N1, uintC N2,
                                  const cl_pqb_series& args,
                                  cl_I* P, cl_I* Q, cl_I* B, cl_I* T)
 {
@@ -75,7 +75,7 @@ static void eval_pqb_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LP, LQ, LB, LT;
                eval_pqb_series_aux(N1,Nm,args,&LP,&LQ,&LB,&LT);
@@ -93,9 +93,9 @@ static void eval_pqb_series_aux (uintL N1, uintL N2,
        }
 }
 
-static void eval_pqsb_series_aux (uintL N1, uintL N2,
+static void eval_pqsb_series_aux (uintC N1, uintC N2,
                                   const cl_pqb_series& args,
-                                  cl_I* P, cl_I* Q, uintL* QS, cl_I* B, cl_I* T)
+                                  cl_I* P, cl_I* Q, uintC* QS, cl_I* B, cl_I* T)
 {
        switch (N2 - N1) {
        case 0:
@@ -150,14 +150,14 @@ static void eval_pqsb_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LP, LQ, LB, LT;
-               var uintL LQS;
+               var uintC LQS;
                eval_pqsb_series_aux(N1,Nm,args,&LP,&LQ,&LQS,&LB,&LT);
                // Compute right part.
                var cl_I RP, RQ, RB, RT;
-               var uintL RQS;
+               var uintC RQS;
                eval_pqsb_series_aux(Nm,N2,args,(P?&RP:(cl_I*)0),&RQ,&RQS,&RB,&RT);
                // Put together partial results.
                if (P) { *P = LP*RP; }
@@ -171,7 +171,7 @@ static void eval_pqsb_series_aux (uintL N1, uintL N2,
        }
 }
 
-const cl_LF eval_rational_series (uintL N, const cl_pqb_series& args, uintC len)
+const cl_LF eval_rational_series (uintC N, const cl_pqb_series& args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
@@ -184,10 +184,10 @@ const cl_LF eval_rational_series (uintL N, const cl_pqb_series& args, uintC len)
                // Split qv[n] into qv[n]*2^qsv[n].
                {
                        var cl_I* qp = args.qv;
-                       var uintL* qsp = args.qsv;
-                       for (var uintL n = 0; n < N; n++, qp++, qsp++) {
+                       var uintC* qsp = args.qsv;
+                       for (var uintC n = 0; n < N; n++, qp++, qsp++) {
                                // Pull out maximal power of 2 out of *qp = args.qv[n].
-                               var uintL qs = 0;
+                               var uintC qs = 0;
                                if (!zerop(*qp)) {
                                        qs = ord2(*qp);
                                        if (qs > 0)
@@ -197,7 +197,7 @@ const cl_LF eval_rational_series (uintL N, const cl_pqb_series& args, uintC len)
                        }
                }
                // Main computation.
-               var uintL QS;
+               var uintC QS;
                eval_pqsb_series_aux(0,N,args,NULL,&Q,&QS,&B,&T);
                return cl_I_to_LF(T,len) / scale_float(cl_I_to_LF(B*Q,len),QS);
        }
index b664e715ac3d30da68fe225bc16e6b5ba51d202d..7897bb2da0c99705261f8fd4bc824ceb68bd27b4 100644 (file)
@@ -22,7 +22,7 @@ namespace cln {
 // and T = B*Q*S (all integers). On entry N1 < N2.
 // P will not be computed if a NULL pointer is passed.
 
-static void eval_q_series_aux (uintL N1, uintL N2,
+static void eval_q_series_aux (uintC N1, uintC N2,
                                const cl_q_series& args,
                                cl_I* Q, cl_I* T)
 {
@@ -58,7 +58,7 @@ static void eval_q_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LQ, LT;
                eval_q_series_aux(N1,Nm,args,&LQ,&LT);
@@ -74,7 +74,7 @@ static void eval_q_series_aux (uintL N1, uintL N2,
        }
 }
 
-const cl_LF eval_rational_series (uintL N, const cl_q_series& args, uintC len)
+const cl_LF eval_rational_series (uintC N, const cl_q_series& args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
index 94554c741583a849411f8596cb1ee367f6886ce1..f94c7540f9bedf0143055dd21789c1100a4dadcc 100644 (file)
@@ -22,7 +22,7 @@ namespace cln {
 // and T = B*Q*S (all integers). On entry N1 < N2.
 // P will not be computed if a NULL pointer is passed.
 
-static void eval_qa_series_aux (uintL N1, uintL N2,
+static void eval_qa_series_aux (uintC N1, uintC N2,
                                 const cl_qa_series& args,
                                 cl_I* Q, cl_I* T)
 {
@@ -58,7 +58,7 @@ static void eval_qa_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LQ, LT;
                eval_qa_series_aux(N1,Nm,args,&LQ,&LT);
@@ -74,7 +74,7 @@ static void eval_qa_series_aux (uintL N1, uintL N2,
        }
 }
 
-const cl_LF eval_rational_series (uintL N, const cl_qa_series& args, uintC len)
+const cl_LF eval_rational_series (uintC N, const cl_qa_series& args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
index 5bdd6eb6a1ecbc94e5c0dfa56ca263b73ce92445..4dadb3bcf6d47b95919030371b0821f3ff98daa5 100644 (file)
@@ -22,7 +22,7 @@ namespace cln {
 // and T = B*Q*S (all integers). On entry N1 < N2.
 // P will not be computed if a NULL pointer is passed.
 
-static void eval_qab_series_aux (uintL N1, uintL N2,
+static void eval_qab_series_aux (uintC N1, uintC N2,
                                  const cl_qab_series& args,
                                  cl_I* Q, cl_I* B, cl_I* T)
 {
@@ -65,7 +65,7 @@ static void eval_qab_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LQ, LB, LT;
                eval_qab_series_aux(N1,Nm,args,&LQ,&LB,&LT);
@@ -82,7 +82,7 @@ static void eval_qab_series_aux (uintL N1, uintL N2,
        }
 }
 
-const cl_LF eval_rational_series (uintL N, const cl_qab_series& args, uintC len)
+const cl_LF eval_rational_series (uintC N, const cl_qab_series& args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
index 761de51e6bfc707a914a3e87353b5ab35c4b911f..58ae23e8119df6da283f2196df330e64a2d3bff6 100644 (file)
@@ -22,7 +22,7 @@ namespace cln {
 // and T = B*Q*S (all integers). On entry N1 < N2.
 // P will not be computed if a NULL pointer is passed.
 
-static void eval_qb_series_aux (uintL N1, uintL N2,
+static void eval_qb_series_aux (uintC N1, uintC N2,
                                 const cl_qb_series& args,
                                 cl_I* Q, cl_I* B, cl_I* T)
 {
@@ -65,7 +65,7 @@ static void eval_qb_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LQ, LB, LT;
                eval_qb_series_aux(N1,Nm,args,&LQ,&LB,&LT);
@@ -82,7 +82,7 @@ static void eval_qb_series_aux (uintL N1, uintL N2,
        }
 }
 
-const cl_LF eval_rational_series (uintL N, const cl_qb_series& args, uintC len)
+const cl_LF eval_rational_series (uintC N, const cl_qb_series& args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
index 0d8fa646db6b0422b8b54710758245919b7befcb..440f85d676151c5165cc186767fb8581999ab765 100644 (file)
@@ -16,7 +16,7 @@
 
 namespace cln {
 
-static void eval_pq_series_aux (uintL N1, uintL N2,
+static void eval_pq_series_aux (uintC N1, uintC N2,
                                 cl_pq_series_stream& args,
                                 cl_I* P, cl_I* Q, cl_I* T)
 {
@@ -73,7 +73,7 @@ static void eval_pq_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LP, LQ, LT;
                eval_pq_series_aux(N1,Nm,args,&LP,&LQ,&LT);
@@ -90,7 +90,7 @@ static void eval_pq_series_aux (uintL N1, uintL N2,
        }
 }
 
-const cl_LF eval_rational_series (uintL N, cl_pq_series_stream& args, uintC len)
+const cl_LF eval_rational_series (uintC N, cl_pq_series_stream& args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
index 5b34c86e83bdec7b6fb0bd6e968a9a8d3c3b589f..1bc6e3066e03a5777cf37bc045641b1e8005529f 100644 (file)
@@ -16,7 +16,7 @@
 
 namespace cln {
 
-static void eval_pqa_series_aux (uintL N1, uintL N2,
+static void eval_pqa_series_aux (uintC N1, uintC N2,
                                  cl_pqa_series_stream& args,
                                  cl_I* P, cl_I* Q, cl_I* T)
 {
@@ -73,7 +73,7 @@ static void eval_pqa_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LP, LQ, LT;
                eval_pqa_series_aux(N1,Nm,args,&LP,&LQ,&LT);
@@ -90,7 +90,7 @@ static void eval_pqa_series_aux (uintL N1, uintL N2,
        }
 }
 
-const cl_LF eval_rational_series (uintL N, cl_pqa_series_stream& args, uintC len)
+const cl_LF eval_rational_series (uintC N, cl_pqa_series_stream& args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
index cc3cec84d2d6446f412b4a6564b46928b8589ec9..376d88ac5a4e6af2ebb8fa7d981bd49749defa83 100644 (file)
@@ -16,7 +16,7 @@
 
 namespace cln {
 
-static void eval_pqab_series_aux (uintL N1, uintL N2,
+static void eval_pqab_series_aux (uintC N1, uintC N2,
                                   cl_pqab_series_stream& args,
                                   cl_I* P, cl_I* Q, cl_I* B, cl_I* T)
 {
@@ -80,7 +80,7 @@ static void eval_pqab_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LP, LQ, LB, LT;
                eval_pqab_series_aux(N1,Nm,args,&LP,&LQ,&LB,&LT);
@@ -98,7 +98,7 @@ static void eval_pqab_series_aux (uintL N1, uintL N2,
        }
 }
 
-const cl_LF eval_rational_series (uintL N, cl_pqab_series_stream& args, uintC len)
+const cl_LF eval_rational_series (uintC N, cl_pqab_series_stream& args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
index 3ce74851a596310666da7de48a956540cbee0d9e..2cfc32a07d6dff3ae342237b17e2fee20efe87f6 100644 (file)
@@ -16,7 +16,7 @@
 
 namespace cln {
 
-static void eval_pqb_series_aux (uintL N1, uintL N2,
+static void eval_pqb_series_aux (uintC N1, uintC N2,
                                  cl_pqb_series_stream& args,
                                  cl_I* P, cl_I* Q, cl_I* B, cl_I* T)
 {
@@ -80,7 +80,7 @@ static void eval_pqb_series_aux (uintL N1, uintL N2,
                break;
                }
        default: {
-               var uintL Nm = (N1+N2)/2; // midpoint
+               var uintC Nm = (N1+N2)/2; // midpoint
                // Compute left part.
                var cl_I LP, LQ, LB, LT;
                eval_pqb_series_aux(N1,Nm,args,&LP,&LQ,&LB,&LT);
@@ -98,7 +98,7 @@ static void eval_pqb_series_aux (uintL N1, uintL N2,
        }
 }
 
-const cl_LF eval_rational_series (uintL N, cl_pqb_series_stream& args, uintC len)
+const cl_LF eval_rational_series (uintC N, cl_pqb_series_stream& args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
index 618c9946768721c6f7b23790d999372e89ac0489..7c22c811b10a13f8521dcf2e5479d96c06525f66 100644 (file)
@@ -16,7 +16,7 @@
 
 namespace cln {
 
-const cl_LF eval_pqcd_series (uintL N, cl_pqcd_series_term* args, uintC len)
+const cl_LF eval_pqcd_series (uintC N, cl_pqcd_series_term* args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
index 336538921441d10ab822b2ea3bd6da6bb6baa733..232214e75052aecededd849cc07ec51ed8bc312f 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace cln {
 
-void eval_pqcd_series_aux (uintL N, cl_pqcd_series_term* args, cl_pqcd_series_result& Z, cl_boolean rightmost)
+void eval_pqcd_series_aux (uintC N, cl_pqcd_series_term* args, cl_pqcd_series_result& Z, cl_boolean rightmost)
 {
        // N = N2-N1
        switch (N) {
@@ -57,7 +57,7 @@ void eval_pqcd_series_aux (uintL N, cl_pqcd_series_term* args, cl_pqcd_series_re
                break;
                }
        default: {
-               var uintL Nm = N/2; // midpoint
+               var uintC Nm = N/2; // midpoint
                // Compute left part.
                var cl_pqcd_series_result L;
                eval_pqcd_series_aux(Nm,args+0,L,cl_false);
index fab0ff22288ad268066cb696051be11e851416bb..7db496c7c8f39d43467538061b442fe2f676cc7a 100644 (file)
@@ -16,7 +16,7 @@
 
 namespace cln {
 
-const cl_LF eval_pqd_series (uintL N, cl_pqd_series_term* args, uintC len)
+const cl_LF eval_pqd_series (uintC N, cl_pqd_series_term* args, uintC len)
 {
        if (N==0)
                return cl_I_to_LF(0,len);
index 25f7d833e17deccf074fa0fa36b3487ff5a57433..7abf6668780a693451e5bf7bf8b7f58a1d322294 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace cln {
 
-void eval_pqd_series_aux (uintL N, cl_pqd_series_term* args, cl_pqd_series_result& Z, cl_boolean rightmost)
+void eval_pqd_series_aux (uintC N, cl_pqd_series_term* args, cl_pqd_series_result& Z, cl_boolean rightmost)
 {
        // N = N2-N1
        switch (N) {
@@ -53,7 +53,7 @@ void eval_pqd_series_aux (uintL N, cl_pqd_series_term* args, cl_pqd_series_resul
                break;
                }
        default: {
-               var uintL Nm = N/2; // midpoint
+               var uintC Nm = N/2; // midpoint
                // Compute left part.
                var cl_pqd_series_result L;
                eval_pqd_series_aux(Nm,args+0,L,cl_false);
index 05ab5aabea7816f259f4fd7ea4d798cad0597d7f..3dedf50caca8a4e7147ad4721b3e1e4a624de900 100644 (file)
@@ -28,9 +28,9 @@ struct cl_rational_series {
              cl_I* qv;
        const cl_I* av;
        const cl_I* bv;
-            uintL* qsv;
+            uintC* qsv;
 };
-extern const cl_LF eval_rational_series (uintL N, const cl_rational_series& args, uintC len);
+extern const cl_LF eval_rational_series (uintC N, const cl_rational_series& args, uintC len);
 
 // In each the special cases below, none of (a,b,p,q) can be NULL. But qs can
 // still be given or NULL.
@@ -40,104 +40,104 @@ struct cl_pqab_series {
              cl_I* qv;
        const cl_I* av;
        const cl_I* bv;
-            uintL* qsv;
+            uintC* qsv;
 };
-extern const cl_LF eval_rational_series (uintL N, const cl_pqab_series& args, uintC len);
+extern const cl_LF eval_rational_series (uintC N, const cl_pqab_series& args, uintC len);
 
 struct cl_pqb_series {
        const cl_I* pv;
              cl_I* qv;
        const cl_I* bv;
-            uintL* qsv;
+            uintC* qsv;
 };
-extern const cl_LF eval_rational_series (uintL N, const cl_pqb_series& args, uintC len);
+extern const cl_LF eval_rational_series (uintC N, const cl_pqb_series& args, uintC len);
 
 struct cl_pqa_series {
        const cl_I* pv;
              cl_I* qv;
        const cl_I* av;
-            uintL* qsv;
+            uintC* qsv;
 };
-extern const cl_LF eval_rational_series (uintL N, const cl_pqa_series& args, uintC len);
+extern const cl_LF eval_rational_series (uintC N, const cl_pqa_series& args, uintC len);
 
 struct cl_pq_series {
        const cl_I* pv;
              cl_I* qv;
-            uintL* qsv;
+            uintC* qsv;
 };
-extern const cl_LF eval_rational_series (uintL N, const cl_pq_series& args, uintC len);
+extern const cl_LF eval_rational_series (uintC N, const cl_pq_series& args, uintC len);
 
 struct cl_pab_series {
        const cl_I* pv;
        const cl_I* av;
        const cl_I* bv;
 };
-extern const cl_LF eval_rational_series (uintL N, const cl_pab_series& args, uintC len);
+extern const cl_LF eval_rational_series (uintC N, const cl_pab_series& args, uintC len);
 
 struct cl_pb_series {
        const cl_I* pv;
        const cl_I* bv;
 };
-extern const cl_LF eval_rational_series (uintL N, const cl_pb_series& args, uintC len);
+extern const cl_LF eval_rational_series (uintC N, const cl_pb_series& args, uintC len);
 
 struct cl_pa_series {
        const cl_I* pv;
        const cl_I* av;
 };
-extern const cl_LF eval_rational_series (uintL N, const cl_pa_series& args, uintC len);
+extern const cl_LF eval_rational_series (uintC N, const cl_pa_series& args, uintC len);
 
 struct cl_p_series {
        const cl_I* pv;
 };
-extern const cl_LF eval_rational_series (uintL N, const cl_p_series& args, uintC len);
+extern const cl_LF eval_rational_series (uintC N, const cl_p_series& args, uintC len);
 
 struct cl_qab_series {
              cl_I* qv;
        const cl_I* av;
        const cl_I* bv;
-            uintL* qsv;
+            uintC* qsv;
 };
-extern const cl_LF eval_rational_series (uintL N, const cl_qab_series& args, uintC len);
+extern const cl_LF eval_rational_series (uintC N, const cl_qab_series& args, uintC len);
 
 struct cl_qb_series {
              cl_I* qv;
        const cl_I* bv;
-            uintL* qsv;
+            uintC* qsv;
 };
-extern const cl_LF eval_rational_series (uintL N, const cl_qb_series& args, uintC len);
+extern const cl_LF eval_rational_series (uintC N, const cl_qb_series& args, uintC len);
 
 struct cl_qa_series {
              cl_I* qv;
        const cl_I* av;
-            uintL* qsv;
+            uintC* qsv;
 };
-extern const cl_LF eval_rational_series (uintL N, const cl_qa_series& args, uintC len);
+extern const cl_LF eval_rational_series (uintC N, const cl_qa_series& args, uintC len);
 
 struct cl_q_series {
              cl_I* qv;
-            uintL* qsv;
+            uintC* qsv;
 };
-extern const cl_LF eval_rational_series (uintL N, const cl_q_series& args, uintC len);
+extern const cl_LF eval_rational_series (uintC N, const cl_q_series& args, uintC len);
 
 struct cl_ab_series {
        const cl_I* av;
        const cl_I* bv;
 };
-extern const cl_LF eval_rational_series (uintL N, const cl_ab_series& args, uintC len);
+extern const cl_LF eval_rational_series (uintC N, const cl_ab_series& args, uintC len);
 
 struct cl_b_series {
        const cl_I* bv;
 };
-extern const cl_LF eval_rational_series (uintL N, const cl_b_series& args, uintC len);
+extern const cl_LF eval_rational_series (uintC N, const cl_b_series& args, uintC len);
 
 struct cl_a_series {
        const cl_I* av;
 };
-extern const cl_LF eval_rational_series (uintL N, const cl_a_series& args, uintC len);
+extern const cl_LF eval_rational_series (uintC N, const cl_a_series& args, uintC len);
 
 struct cl__series {
 };
-extern const cl_LF eval_rational_series (uintL N, const cl__series& args, uintC len);
+extern const cl_LF eval_rational_series (uintC N, const cl__series& args, uintC len);
 
 
 // In this alternate implementation the series is not represented as a couple
@@ -160,7 +160,7 @@ struct cl_pqab_series_stream {
        // Constructor.
        cl_pqab_series_stream (cl_pqab_series_term (*n)(cl_pqab_series_stream&)) : nextfn (n) {}
 };
-extern const cl_LF eval_rational_series (uintL N, cl_pqab_series_stream& args, uintC len);
+extern const cl_LF eval_rational_series (uintC N, cl_pqab_series_stream& args, uintC len);
 
 struct cl_pqb_series_term {
        cl_I p;
@@ -173,7 +173,7 @@ struct cl_pqb_series_stream {
        // Constructor.
        cl_pqb_series_stream (cl_pqb_series_term (*n)(cl_pqb_series_stream&)) : nextfn (n) {}
 };
-extern const cl_LF eval_rational_series (uintL N, cl_pqb_series_stream& args, uintC len);
+extern const cl_LF eval_rational_series (uintC N, cl_pqb_series_stream& args, uintC len);
 
 struct cl_pqa_series_term {
        cl_I p;
@@ -186,7 +186,7 @@ struct cl_pqa_series_stream {
        // Constructor.
        cl_pqa_series_stream (cl_pqa_series_term (*n)(cl_pqa_series_stream&)) : nextfn (n) {}
 };
-extern const cl_LF eval_rational_series (uintL N, cl_pqa_series_stream& args, uintC len);
+extern const cl_LF eval_rational_series (uintC N, cl_pqa_series_stream& args, uintC len);
 
 struct cl_pq_series_term {
        cl_I p;
@@ -198,7 +198,7 @@ struct cl_pq_series_stream {
        // Constructor.
        cl_pq_series_stream (cl_pq_series_term (*n)(cl_pq_series_stream&)) : nextfn (n) {}
 };
-extern const cl_LF eval_rational_series (uintL N, cl_pq_series_stream& args, uintC len);
+extern const cl_LF eval_rational_series (uintC N, cl_pq_series_stream& args, uintC len);
 
 
 // [Generalization.]
@@ -227,9 +227,9 @@ struct cl_pqcd_series_result {
        cl_I D;
        cl_I V;
 };
-extern void eval_pqcd_series_aux (uintL N, cl_pqcd_series_term* args, cl_pqcd_series_result& Z, cl_boolean rightmost = cl_true);
+extern void eval_pqcd_series_aux (uintC N, cl_pqcd_series_term* args, cl_pqcd_series_result& Z, cl_boolean rightmost = cl_true);
 // Ditto, but returns U/S.
-extern const cl_LF eval_pqcd_series (uintL N, cl_pqcd_series_term* args, uintC len);
+extern const cl_LF eval_pqcd_series (uintC N, cl_pqcd_series_term* args, uintC len);
 
 // [Special case c(n)=1.]
 // Subroutine:
@@ -255,9 +255,9 @@ struct cl_pqd_series_result {
        cl_I D;
        cl_I V;
 };
-extern void eval_pqd_series_aux (uintL N, cl_pqd_series_term* args, cl_pqd_series_result& Z, cl_boolean rightmost = cl_true);
+extern void eval_pqd_series_aux (uintC N, cl_pqd_series_term* args, cl_pqd_series_result& Z, cl_boolean rightmost = cl_true);
 // Ditto, but returns U/S.
-extern const cl_LF eval_pqd_series (uintL N, cl_pqd_series_term* args, uintC len);
+extern const cl_LF eval_pqd_series (uintC N, cl_pqd_series_term* args, uintC len);
 
 }  // namespace cln
 
index 980eec2254847497bdadcb2906aef7c2b4d8afa4..459b28d9b74e36eb67b45c64dcbae95b4d280679 100644 (file)
@@ -39,13 +39,13 @@ const cl_LF zeta3 (uintC len)
        //   a(n) = 205*n^2+250*n+77, b(n) = 1,
        //   p(0) = 1, p(n) = -n^5 for n>0, q(n) = 32*(2n+1)^5.
        var uintC actuallen = len+2; // 2 Schutz-Digits
-       var uintL N = ceiling(actuallen*intDsize,10);
+       var uintC N = ceiling(actuallen*intDsize,10);
        // 1024^-N <= 2^(-intDsize*actuallen).
        CL_ALLOCA_STACK;
        var cl_I* av = (cl_I*) cl_alloca(N*sizeof(cl_I));
        var cl_I* pv = (cl_I*) cl_alloca(N*sizeof(cl_I));
        var cl_I* qv = (cl_I*) cl_alloca(N*sizeof(cl_I));
-       var uintL n;
+       var uintC n;
        for (n = 0; n < N; n++) {
                init1(cl_I, av[n]) (205*square((cl_I)n) + 250*(cl_I)n + 77);
                if (n==0)
index 281f763f04d6bc5cb971266e4b255c7999c1ec30..6070fd50bd1c899b38016ffd57b3e2402cafd677 100644 (file)
@@ -25,11 +25,11 @@ const cl_LF compute_zeta_exp (int s, uintC len)
        // with convergence acceleration through exp(x), and evaluated
        // using the binary-splitting algorithm.
        var uintC actuallen = len+2; // 2 Schutz-Digits
-       var uintL x = (uintL)(0.693148*intDsize*actuallen)+1;
-       var uintL N = (uintL)(2.718281828*x);
+       var uintC x = (uintC)(0.693148*intDsize*actuallen)+1;
+       var uintC N = (uintC)(2.718281828*x);
        CL_ALLOCA_STACK;
        var cl_pqd_series_term* args = (cl_pqd_series_term*) cl_alloca(N*sizeof(cl_pqd_series_term));
-       var uintL n;
+       var uintC n;
        for (n = 0; n < N; n++) {
                if (n==0) {
                        init1(cl_I, args[n].p) (1);
@@ -60,12 +60,12 @@ const cl_LF compute_zeta_cvz1 (int s, uintC len)
        // zeta(s) = 1/(1-2^(1-s)) sum(n=0..infty, (-1)^n/(n+1)^s),
        // with Cohen-Villegas-Zagier convergence acceleration.
        var uintC actuallen = len+2; // 2 Schutz-Digits
-       var uintL N = (uintL)(0.39321985*intDsize*actuallen)+1;
+       var uintC N = (uintC)(0.39321985*intDsize*actuallen)+1;
        var cl_I fterm = 2*(cl_I)N*(cl_I)N;
        var cl_I fsum = fterm;
        var cl_LF gterm = cl_I_to_LF(fterm,actuallen);
        var cl_LF gsum = gterm;
-       var uintL n;
+       var uintC n;
        // After n loops
        //   fterm = (N+n)!N/(2n+2)!(N-n-1)!*2^(2n+2), fsum = ... + fterm,
        //   gterm = S_n*fterm, gsum = ... + gterm.
@@ -93,10 +93,10 @@ const cl_LF compute_zeta_cvz2 (int s, uintC len)
        // with Cohen-Villegas-Zagier convergence acceleration, and
        // evaluated using the binary splitting algorithm.
        var uintC actuallen = len+2; // 2 Schutz-Digits
-       var uintL N = (uintL)(0.39321985*intDsize*actuallen)+1;
+       var uintC N = (uintC)(0.39321985*intDsize*actuallen)+1;
        CL_ALLOCA_STACK;
        var cl_pqd_series_term* args = (cl_pqd_series_term*) cl_alloca(N*sizeof(cl_pqd_series_term));
-       var uintL n;
+       var uintC n;
        for (n = 0; n < N; n++) {
                init1(cl_I, args[n].p) (2*(cl_I)(N-n)*(cl_I)(N+n));
                init1(cl_I, args[n].q) ((cl_I)(2*n+1)*(cl_I)(n+1));
index 497f10a58f723a0e0b6f93b0f228deae16496bd2..678a314364d3f2131bb4fe6f55c9b22d6456a00f 100644 (file)
@@ -23,10 +23,10 @@ cl_boolean rootp (const cl_I& x, const cl_I& n, cl_I* w)
 {
        if (eq(x,0) || eq(x,1)) // x=0 oder x=1 ?
          { *w = x; return cl_true; } // ja -> x als Ergebnis
-       if (n >= UL_to_I(integer_length(x)))
+       if (n >= (cl_I)(unsigned long)integer_length(x))
          { return cl_false; }
-       // Nun ist n < (integer-length x). Also paßt n in ein uintL.
-       return cl_rootp_aux(x,cl_I_to_UL(n),w);
+       // Nun ist n < (integer-length x). Also paßt n in ein uintC.
+       return cl_rootp_aux(x,cl_I_to_ulong(n),w);
 }
 
 }  // namespace cln
index 4e53d1c8741e41448109a4b86e05c2d7978088cf..ad0a8900b0a1aab957d82c0b7d24491abd83b0d1 100644 (file)
@@ -64,14 +64,14 @@ cl_boolean cl_rootp_aux (cl_I x, uintL n, cl_I* w)
         }
       // Nun ist n ungerade.
       if (n==1) { *w = x; return cl_true; } // n=1 -> x als Ergebnis
-      var uintL oq = 0; // Shift von y am Schluß
-      {var uintL o = ord2(x);
+      var uintC oq = 0; // Shift von y am Schluß
+      {var uintC o = ord2(x);
        if (!(o==0))
          {var uintL o_r; divu_3232_3232(o,n, oq=,o_r=); // o_r = o mod n
           if (!(o_r==0)) { return cl_false; } // o nicht durch n teilbar -> fertig
           // oq = o/n.
           // dividiere x durch 2^o:
-          x = ash(x,-(sintL)o);
+          x = ash(x,-(sintC)o);
       }  }
       // Nun ist n ungerade, x ungerade.
       CL_ALLOCA_STACK;
@@ -110,21 +110,21 @@ cl_boolean cl_rootp_aux (cl_I x, uintL n, cl_I* w)
       y_lsd_ok:
       ASSERT(expt_pos(y_lsd,n)==x_lsd);
       // Nun ist y_lsd^n == x_lsd mod beta=2^intDsize.
-      { var uintL m = ceiling((uintL)x_len,n); // für y nötige Länge, >0, <=x_len
+      { var uintC m = ceiling(x_len,n); // für y nötige Länge, >0, <=x_len
         var uintD* y_LSDptr;
         { var uintD* z1_LSDptr;
           var uintD* z2_LSDptr;
           var uintD* z3_LSDptr;
           num_stack_alloc_1(m, ,y_LSDptr=); // Platz für y
-          {var uintL need = 2*m+(32/intDsize-1); // >= max(2*m,m+32/intDsize)
+          {var uintC need = 2*m+(32/intDsize-1); // >= max(2*m,m+32/intDsize)
            num_stack_alloc(need, ,z1_LSDptr=); // Platz für Rechenregister 1
            num_stack_alloc(need, ,z2_LSDptr=); // Platz für Rechenregister 2
            num_stack_alloc(need, ,z3_LSDptr=); // Platz für Rechenregister 3
           }
-         {var uintL k = 1; // y ist bisher mod beta^k bekannt
+         {var uintC k = 1; // y ist bisher mod beta^k bekannt
           lspref(y_LSDptr,0) = y_lsd; // Startwert von y
           until (k==m)
-            { var uintL k2 = 2*k; if (k2>m) { k2=m; } // k2 = min(2*k,m) > k
+            { var uintC k2 = 2*k; if (k2>m) { k2=m; } // k2 = min(2*k,m) > k
               // bisheriges y mod beta^k2 mit n-1 potenzieren:
               // Methode für z := y^(n-1) :
               //   zz:=y, e:=n-1.
index bde719bf8cd50b623f53ffa1c141a51ba6046511..db355e4a33e085f69e3713faeb3a332742a6f2b4 100644 (file)
@@ -15,7 +15,7 @@
 
 namespace cln {
 
-const cl_I ash (const cl_I& x, sintL y)
+const cl_I ash (const cl_I& x, sintC y)
 {
     // Methode:
     // x = 0 -> 0 als Ergebnis
@@ -34,14 +34,14 @@ const cl_I ash (const cl_I& x, sintL y)
        CL_ALLOCA_STACK;
        if (y >= 0) {
                // y>0
-               var uintL y_ = (uintL)y;
+               var uintC y_ = (uintC)y;
                var uintL i = y_%intDsize; // i = y mod intDsize, >=0, <intDsize
-               var uintL k = floor(y_,intDsize); // k = y div intDsize, >=0, <2^intCsize
+               var uintC k = floor(y_,intDsize); // k = y div intDsize, >=0, <2^intCsize
                var uintD* LSDptr;
                var uintC len;
                var const uintD* x_LSDptr;
                I_to_NDS_nocopy(x, ,len=,x_LSDptr=,cl_false,); // DS zu x bilden.
-               if (k >= (uintC)(~(uintC)len)) // kann len+k+1 Ãœberlauf geben?
+               if (k >= (uintC)(~len)) // kann len+k+1 Ãœberlauf geben?
                        { cl_ash_error(y); } // ja -> Fehler
                num_stack_alloc_1(len+k,,LSDptr=);
                LSDptr = clear_loop_lsp(LSDptr,k); // k Nulldigits
@@ -66,9 +66,9 @@ const cl_I ash (const cl_I& x, sintL y)
               }
        } else {
                // y<0
-               var uintL y_ = (uintL)(-y); // Wert von -y, >0
+               var uintC y_ = (uintC)(-y); // Wert von -y, >0
                var uintL i = y_%intDsize; // i = (-y) mod intDsize, >=0, <intDsize
-               var uintL k = floor(y_,intDsize); // k = (-y) div intDsize, >=0
+               var uintC k = floor(y_,intDsize); // k = (-y) div intDsize, >=0
                // DS zu x bilden:
                var uintD* MSDptr;
                var uintC len;
index 0775e552ad7d9b8972a8ae64343591f17a3fd783..f10e2e77735f0e27dbf13776ea38c36850595623 100644 (file)
@@ -35,7 +35,7 @@ const cl_I ash (const cl_I& x, const cl_I& y)
        if (!minusp(y)) {
                // y>=0
                var uintL i; // i = y mod intDsize, >=0, <intDsize
-               var cl_uint k; // k = y div intDsize, >=0, <2^intCsize
+               var uintC k; // k = y div intDsize, >=0, <2^intCsize
                if (bignump(y)) {
                        #if (log2_intDsize+intCsize <= cl_value_len-1)
                        // y >= 2^(cl_value_len-1) >= intDsize*2^intCsize
@@ -86,7 +86,7 @@ const cl_I ash (const cl_I& x, const cl_I& y)
                var uintC len;
                var const uintD* x_LSDptr;
                I_to_NDS_nocopy(x, ,len=,x_LSDptr=,cl_false,); // DS zu x bilden.
-               if (k >= (uintC)(~(uintC)len)) // kann len+k+1 Ãœberlauf geben?
+               if (k >= (uintC)(~len)) // kann len+k+1 Ãœberlauf geben?
                        { cl_ash_error(y); } // ja -> Fehler
                num_stack_alloc_1(len+k,,LSDptr=);
                LSDptr = clear_loop_lsp(LSDptr,k); // k Nulldigits
@@ -111,7 +111,7 @@ const cl_I ash (const cl_I& x, const cl_I& y)
        } else {
                // y<0
                var uintL i; // i = (-y) mod intDsize, >=0, <intDsize
-               var cl_uint k; // k = (-y) div intDsize, >=0, <2^intCsize
+               var uintC k; // k = (-y) div intDsize, >=0, <2^intCsize
                if (bignump(y)) {
                        #if (log2_intDsize+intCsize <= cl_value_len-1)
                        // -y-1 >= 2^(cl_value_len-1) >= intDsize*2^intCsize
index 2505d8f19f0bf178ab68aeb103db4266e6ff3a5b..6ef57d21a7ffd2bde9a8e6c8d41e2b17fd8fe57d 100644 (file)
@@ -11,22 +11,22 @@ namespace cln {
 // cl_fullbyte(p,q) liefert zu p,q die Zahl 2^q-2^p als Integer,
 // wobei p und q uintL sind. Bei p<=q ist das Ergebnis also
 // ein Integer >=0, bei dem genau die Bits p,...,q-1 gesetzt sind.
-extern const cl_I cl_fullbyte (uintL p, uintL q);
+extern const cl_I cl_fullbyte (uintC p, uintC q);
 
 // Extrahiere die Bits p,...,q-1 der Zahl x,
 // wobei 0 <= p <= q <= l = (integer-length x).
 // Ergebnis (wie bei LDB) ein Integer >=0.
-extern const cl_I ldb_extract (const cl_I& x, uintL p, uintL q);
+extern const cl_I ldb_extract (const cl_I& x, uintC p, uintC q);
 
 // Teste, ob eines der Bits p,...,q-1 der Zahl x /=0 ist,
 // wobei 0 <= p <= q <= l = (integer-length x).
 // Ergebnis (wie bei LDB-TEST) cl_false wenn nein, cl_true wenn ja.
-extern cl_boolean ldb_extract_test (const cl_I& x, uintL p, uintL q);
+extern cl_boolean ldb_extract_test (const cl_I& x, uintC p, uintC q);
 
 // Extrahiere die Bits p,...,q-1 der Zahl x,
 // wobei 0 <= p <= q <= l = (integer-length x).
 // Ergebnis (wie bei MASK-FIELD) ein Integer >=0.
-extern const cl_I mkf_extract (const cl_I& x, uintL p, uintL q);
+extern const cl_I mkf_extract (const cl_I& x, uintC p, uintC q);
 
 }  // namespace cln
 
index 8177a4ce74576fbc41a5350506bf75ad05d3d65a..06cf65e1c8796c41c8856bfdd65fc84bce1a3cce 100644 (file)
 
 namespace cln {
 
-const cl_I cl_fullbyte (uintL p, uintL q)
+const cl_I cl_fullbyte (uintC p, uintC q)
 {
        if (p==q)
                return 0;
        else
-               return ash(-1,UL_to_I(p)) + ash(1,UL_to_I(q));
+               return ash(-1,(cl_I)(unsigned long)p) + ash(1,(cl_I)(unsigned long)q);
 }
 
 }  // namespace cln
index 4bebae0264c9c045cbe12fcaa7780150b7f4e1e5..5620e85d28eb64dc198d18added236687834ff15 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace cln {
 
-uintL integer_length (const cl_I& x)
+uintC integer_length (const cl_I& x)
 {
        if (fixnump(x))
          { var uintL bitcount = 0;
@@ -33,7 +33,7 @@ uintL integer_length (const cl_I& x)
           { var const uintD* MSDptr;
             var uintC len;
             BN_to_NDS_nocopy(x, MSDptr=,len=,); // normalisierte DS zu x bilden.
-            var uintL bitcount = intDsize*(uintL)(len-1); // Anzahl Digits mal intDsize
+            var uintC bitcount = intDsize*(len-1); // Anzahl Digits mal intDsize
             // MSDigit nehmen, testen, welches das höchste Bit ist, das vom
             // Vorzeichenbit abweicht:
             var uintD msd = mspref(MSDptr,0); // MSDigit
index 43d6fc31f532e2a497dbf699d368eaf0c52b3ba7..81fecaf84b785e3fcf6bd9ee50300997aa91225a 100644 (file)
@@ -26,9 +26,9 @@ const cl_I ldb (const cl_I& n, const cl_byte& b)
       //   q:=min(p+s,l).
       //   Extrahiere die Bits p,...,q-1 von n.
       //   Falls p+s>l und n<0, füge p+s-l Einsenbits an (addiere 2^s-2^(l-p)).
-      var uintL s = b.size;
-      var uintL p = b.position;
-      var uintL l = integer_length(n); // l = (integer-length n)
+      var uintC s = b.size;
+      var uintC p = b.position;
+      var uintC l = integer_length(n); // l = (integer-length n)
       if (l<=p)
         // l<=p
         if (!minusp(n))
@@ -40,7 +40,7 @@ const cl_I ldb (const cl_I& n, const cl_byte& b)
         else
         // l>p
         { var cl_I erg = ldb_extract(n,p,(p+s<l ? p+s : l));
-          var uintL lp = l-p;
+          var uintC lp = l-p;
           if ((s>lp) && minusp(n)) // s>l-p und n<0 ?
             { return logior(erg,cl_fullbyte(lp,s)); } // setze Bits l-p,...,s-1
             // (logisches Exklusiv-Oder oder Addition ginge auch)
index 9b62a97d89613a8ee029d4ef9a10e773c044bc45..c902008e16a6f00f364ca57e992ede6ff1177e41 100644 (file)
@@ -29,10 +29,10 @@ cl_boolean ldb_test (const cl_I& n, const cl_byte& b)
       //                       und bei n<0 sind Bits p+s-1..l =1.
       //     Falls p+s<=l,
       //       extrahiere die Bits p,...,p+s-1 von n und teste sie.
-      var uintL s = b.size;
-      var uintL p = b.position;
+      var uintC s = b.size;
+      var uintC p = b.position;
       if (s==0) return cl_false;
-      var uintL l = integer_length(n); // l = (integer-length n)
+      var uintC l = integer_length(n); // l = (integer-length n)
       if (l<=p)
         // l<=p
         if (!minusp(n))
@@ -41,7 +41,7 @@ cl_boolean ldb_test (const cl_I& n, const cl_byte& b)
           return cl_true; // n<0
         else
         // l>p
-        { var uintL ps = p+s;
+        { var uintC ps = p+s;
           if (ps>l) // p+s>l ?
             return cl_true;
           // Bits p,...,q-1 mit q = min(p+s,l) = p+s extrahieren und testen:
index 788133b136aa34d473b33f1f5defbf89c626bfb0..2a015165dba915385a01df33414cb419b0d93811 100644 (file)
 
 namespace cln {
 
-const cl_I ldb_extract (const cl_I& x, uintL p, uintL q)
+const cl_I ldb_extract (const cl_I& x, uintC p, uintC q)
     { CL_ALLOCA_STACK;
       var const uintD* MSDptr;
       var uintC len;
       var const uintD* LSDptr;
       I_to_NDS_nocopy(x, MSDptr=,len=,LSDptr=,cl_true, { return 0; } ); // NDS zu x bilden
       // MSDptr erhöhen und len erniedrigen, so daß len = ceiling(q/intDsize) wird:
-      { var uintL qD = ceiling(q,intDsize); // ceiling(q/intDsize)
+      { var uintC qD = ceiling(q,intDsize); // ceiling(q/intDsize)
         // wegen q<=l ist qD = ceiling(q/intDsize) <= ceiling((l+1)/intDsize) = len, also
         // paßt qD ebenso wie len in ein uintC.
-        MSDptr = MSDptr mspop ((uintL)len - qD); // MSDptr um len-qD Digits erhöhen
+        MSDptr = MSDptr mspop (len - qD); // MSDptr um len-qD Digits erhöhen
         len = qD; // len um len-qD erniedrigen
       }
       // LSDptr und len um floor(p/intDsize) erniedrigen:
-      { var uintL pD = floor(p,intDsize); // floor(p/intDsize)
+      { var uintC pD = floor(p,intDsize); // floor(p/intDsize)
         LSDptr = LSDptr lspop pD;
         len -= pD;
       }
@@ -37,7 +37,7 @@ const cl_I ldb_extract (const cl_I& x, uintL p, uintL q)
       var uintD* newMSDptr;
       { var uintL i = p%intDsize; // p mod intDsize
         // Kopiere sie und schiebe sie dabei um i Bits nach rechts:
-        num_stack_alloc_1((uintL)len, newMSDptr=,); // neue UDS newMSDptr/len/..
+        num_stack_alloc_1(len, newMSDptr=,); // neue UDS newMSDptr/len/..
         if (i==0)
           { copy_loop_msp(MSDptr,newMSDptr,len); }
           else
@@ -45,7 +45,7 @@ const cl_I ldb_extract (const cl_I& x, uintL p, uintL q)
       }
       // newMSDptr/len/.. = geschobene Kopie der maßgeblichen Digits
       // Ausblenden der Bits mit Nummern >= q-p:
-      { var uintL bitcount = intDsize*(uintL)len - (q-p);
+      { var uintC bitcount = intDsize*len - (q-p);
         // Anzahl vorne auszublendender Bits ( >=0, <= intDsize-1 + intDsize-1 )
         if (bitcount>=intDsize)
           { bitcount -= intDsize; msshrink(newMSDptr); len -= 1; } // intDsize Bits ausblenden
index 9ee07672832e2f707c034d550335eb2f22cf39c6..d5447e7eb8c302865c5ceb121be7f9de531fa9ef 100644 (file)
 
 namespace cln {
 
-cl_boolean ldb_extract_test (const cl_I& x, uintL p, uintL q)
+cl_boolean ldb_extract_test (const cl_I& x, uintC p, uintC q)
     { var const uintD* MSDptr;
       var uintC len;
       var const uintD* LSDptr;
       I_to_NDS_nocopy(x, MSDptr=,len=,LSDptr=,cl_true, { return cl_false; } ); // NDS zu x bilden
       // MSDptr erhöhen und len erniedrigen, so daß len = ceiling(q/intDsize) wird:
-      { var uintL qD = ceiling(q,intDsize); // ceiling(q/intDsize)
+      { var uintC qD = ceiling(q,intDsize); // ceiling(q/intDsize)
         // wegen q<=l ist qD = ceiling(q/intDsize) <= ceiling((l+1)/intDsize) = len, also
         // paßt qD ebenso wie len in ein uintC.
-        MSDptr = MSDptr mspop ((uintL)len - qD); // MSDptr um len-qD Digits erhöhen
+        MSDptr = MSDptr mspop (len - qD); // MSDptr um len-qD Digits erhöhen
         len = qD; // len um len-qD erniedrigen
       }
       // LSDptr und len um floor(p/intDsize) erniedrigen:
-      { var uintL pD = p/intDsize; // floor(p/intDsize)
+      { var uintC pD = p/intDsize; // floor(p/intDsize)
         LSDptr = LSDptr lspop pD;
         len -= pD;
       }
index 5eedaa5d073cd15c4c425428caf6b386e4e35cb8..8227b2e773bdd7d45c7ececd0c7c04f895eebf15 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace cln {
 
-cl_boolean logbitp (uintL x, const cl_I& y)
+cl_boolean logbitp (uintC x, const cl_I& y)
 {
     // Methode:
     // Falls x>=intDsize*Länge(y), teste Vorzeichen von y.
@@ -24,7 +24,7 @@ cl_boolean logbitp (uintL x, const cl_I& y)
        var uintC ylen;
        var const uintD* yLSDptr;
        I_to_NDS_nocopy(y, yMSDptr=,ylen=,yLSDptr=,cl_true, { return cl_false; } ); // DS zu y
-       if (x < intDsize*(uintL)ylen)
+       if (x < intDsize*ylen)
                // x ist >=0, < intDsize*ylen
                { if (lspref(yLSDptr,floor(x,intDsize)) & bit(x%intDsize))
                    return cl_true;
index 2c40a1d3200f33d9d580346e6b4924e1e9c8ef3d..c1b87ad513b6bac2e1ea552e35c78a0d02b66395 100644 (file)
@@ -29,7 +29,7 @@ cl_boolean logbitp (const cl_I& x, const cl_I& y)
               var uintC ylen;
               var const uintD* yLSDptr;
               I_to_NDS_nocopy(y, ,ylen=,yLSDptr=,cl_true, { return cl_false; } ); // DS zu y
-              if (x_ < intDsize*(uintL)ylen)
+              if (x_ < intDsize*ylen)
                 // x ist ein Fixnum >=0, < intDsize*ylen
                 { if (lspref(yLSDptr,floor(x_,intDsize)) & bit(x_%intDsize))
                     return cl_true;
index dd293bf45cddd48e72c62951438f4e4f57986bec..62a1814b2c30e751d88d91f93735568c97beaf51 100644 (file)
@@ -16,7 +16,7 @@
 
 namespace cln {
 
-uintL logcount (const cl_I& x)
+uintC logcount (const cl_I& x)
 {
        if (fixnump(x))
          { var uintV x32 = FN_to_V(x); // x als intDsize-Bit-Zahl
@@ -34,11 +34,11 @@ uintL logcount (const cl_I& x)
           { var const uintD* MSDptr;
             var uintC len;
             BN_to_NDS_nocopy(x, MSDptr=,len=,); // DS zu x bilden, len>0.
-            var uintL bitcount = 0; // Bitzähler
+            var uintC bitcount = 0; // Bitzähler
             var const uintD* ptr = MSDptr; // läuft durch die Digits durch
             var uintD sign = sign_of_sintD(mspref(ptr,0)); // Vorzeichen
             dotimespC(len,len,
-              { bitcount += (uintL)logcountD(msprefnext(ptr) ^ sign); });
+              { bitcount += (uintC)logcountD(msprefnext(ptr) ^ sign); });
             // 0 <= bitcount < intDsize*2^intCsize.
             return bitcount;
           }
index f496376bb51c26a7f598b74964ebf8d196adb2d9..86c49eac0028a5e5774951cc675effd3a53d0dab 100644 (file)
@@ -26,10 +26,10 @@ const cl_I mask_field (const cl_I& n, const cl_byte& b)
       //   q:=min(p+s,l).
       //   Extrahiere die Bits p,...,q-1 von n.
       //   Falls p+s>l und n<0, füge p+s-l Einsenbits an (addiere 2^(p+s)-2^l).
-      var uintL s = b.size;
-      var uintL p = b.position;
-     {var uintL ps = p+s;
-      var uintL l = integer_length(n); // l = (integer-length n)
+      var uintC s = b.size;
+      var uintC p = b.position;
+     {var uintC ps = p+s;
+      var uintC l = integer_length(n); // l = (integer-length n)
       if (l<=p)
         // l<=p
         if (!minusp(n))
index dd6b4239afc626d7f67742e30cf3d5fa2d66b366..9df0edfaca85af2f9851933bba2bc00630a01501 100644 (file)
@@ -15,7 +15,7 @@
 
 namespace cln {
 
-const cl_I mkf_extract (const cl_I& x, uintL p, uintL q)
+const cl_I mkf_extract (const cl_I& x, uintC p, uintC q)
 {
       CL_ALLOCA_STACK;
       var const uintD* MSDptr;
@@ -23,20 +23,20 @@ const cl_I mkf_extract (const cl_I& x, uintL p, uintL q)
       var const uintD* LSDptr;
       I_to_NDS_nocopy(x, MSDptr=,len=,LSDptr=,cl_true, { return 0; } ); // NDS zu x bilden
       // MSDptr erhöhen und len erniedrigen, so daß len = ceiling(q/intDsize) wird:
-      { var uintL qD = ceiling(q,intDsize); // ceiling(q/intDsize)
+      { var uintC qD = ceiling(q,intDsize); // ceiling(q/intDsize)
         // wegen q<=l ist qD = ceiling(q/intDsize) <= ceiling((l+1)/intDsize) = len, also
         // paßt qD ebenso wie len in ein uintC.
-        MSDptr = MSDptr mspop ((uintL)len - qD); // MSDptr um len-qD Digits erhöhen
+        MSDptr = MSDptr mspop (len - qD); // MSDptr um len-qD Digits erhöhen
         len = qD; // len um len-qD erniedrigen
       }
       // Platz (len Digits) für die neue UDS bereitstellen:
       var uintD* newMSDptr;
-      num_stack_alloc_1((uintL)len, newMSDptr = ,); // Platz belegen
-      {var uintL pD = p/intDsize; // floor(p/intDsize), paßt in ein uintC
+      num_stack_alloc_1(len, newMSDptr = ,); // Platz belegen
+      {var uintC pD = p/intDsize; // floor(p/intDsize), paßt in ein uintC
        // Kopiere len-pD Digits aus der DS zu x heraus:
-       var uintD* midptr = copy_loop_msp(MSDptr,newMSDptr,len-(uintC)pD);
+       var uintD* midptr = copy_loop_msp(MSDptr,newMSDptr,len-pD);
        // Lösche p-intDsize*floor(p/intDsize) Bits im Digit unterhalb von midptr:
-       {var uintL p_D = p%intDsize;
+       {var uintC p_D = p%intDsize;
         if (!(p_D==0)) { lspref(midptr,0) &= minus_bit(p_D); }
        }
        // Lösche pD Digits darüber:
index 5d5fa8a80aad79ba463d45d604b4beb1c99b4267..52c137d0ecc1d0ca92694f2b354097eed9c85c74 100644 (file)
@@ -42,7 +42,7 @@ inline cl_uint cl_FN_word (const cl_I& x)
 // Bignums.
 
 struct cl_heap_bignum : cl_heap {
-       unsigned int length;    // length (in digits)
+       uintC length;           // length (in digits)
        uintD data[1];          // number in two's complement representation
 };
 
@@ -51,7 +51,7 @@ inline cl_heap_bignum* TheBignum (cl_heap_bignum* p)
 inline cl_heap_bignum* TheBignum (const cl_number& obj)
        { return (cl_heap_bignum*)(obj.pointer); }
 
-inline cl_heap_bignum* allocate_bignum (unsigned int length)
+inline cl_heap_bignum* allocate_bignum (uintC length)
 {
        cl_heap_bignum* p = (cl_heap_bignum*) malloc_hook(offsetofa(cl_heap_bignum,data)+sizeof(uintD)*length);
        p->refcount = 1;
@@ -662,14 +662,14 @@ inline sintD FN_MSD (cl_uint word)
 // > MSBptr/len/..: Ziffernfolge, bestehend aus Punkten (werden Ã¼berlesen)
 //     und Ziffern/Buchstaben mit Wert < base.
 // < ergebnis: der dargestellte Integer >=0
-  extern const cl_I digits_to_I (const char * MSBptr, uintL len, uintD base);
+  extern const cl_I digits_to_I (const char * MSBptr, uintC len, uintD base);
 
 
 // Hilfsfunktion zur Ausgabe von Integers
 
 // cl_digits_need(len,base) liefert eine obere Abschätzung für die Anzahl der
 // Ziffern im Stellenwertsystem der Basis base, die x >= 0 braucht.
-  extern uintL cl_digits_need (const cl_I& x, uintL base);
+  extern uintC cl_digits_need (const cl_I& x, uintL base);
 
 // Wandelt ein Integer in ein Stellensystem um.
 // I_to_digits(x,base, &ergebnis);
@@ -677,7 +677,7 @@ inline sintD FN_MSD (cl_uint word)
 // > base: Stellensystem-Basis, 2 <= base <= 36.
 // > ergebnis.LSBptr: darunter ist mindestens digits_need(len) Bytes Platz
 // < ergebnis: fertige Folge MSBptr/len/LSBptr von Ziffern
-  typedef struct { uintB* MSBptr; uintL len; uintB* LSBptr; } cl_digits;
+  typedef struct { uintB* MSBptr; uintC len; uintB* LSBptr; } cl_digits;
   extern void I_to_digits (const cl_I& x, uintD base, cl_digits* erg);
 
 
index 1c6899acd30bfd1b3f280449cfd5d56039cf6f32..78324dc4a1d2d56c820d4389ae8c3514ec4f2619 100644 (file)
@@ -31,7 +31,7 @@ struct cached_power_table_entry {
 };\r
 \r
 struct cached_power_table {\r
-       cached_power_table_entry element[30];\r
+       cached_power_table_entry element[40];\r
        // Constructor and destructor - nothing special.\r
        cached_power_table () {}\r
        ~cached_power_table () {}\r
index aefaab98cec914e5c66d105fc03ea467ff2ab167..50ca374483a8773e5f6f2770ea90f789efc4ebd2 100644 (file)
 
 namespace cln {
 
-uintL cl_digits_need (const cl_I& x, uintL base)
+uintC cl_digits_need (const cl_I& x, uintL base)
 {
   if (fixnump(x))
     { return cl_value_len; } // x < 2^cl_value_len, base >= 2, also reicht das
   else
     { var uintC len = TheBignum(x)->length;
       // 1+ceiling(len * intDsize*log(2)/log(base)) Bytes oder etwas mehr
-      var uintL need = 1+floor(len,1024/intDsize); // > ceiling(len*intDsize/1024) >= 0
+      var uintC need = 1+floor(len,1024/intDsize); // > ceiling(len*intDsize/1024) >= 0
       switch (base) // need mit ceiling(1024*log(2)/log(base)) multiplizieren:
         { case 2: need = 1024*need; break;
           case 3: need = 647*need; break;
index bbb1a51f9cb7f1d6cff8edb31f4979025177ed66..82fc71e868f97c05184fd4f800f4569c1ec7ff4e 100644 (file)
@@ -14,7 +14,7 @@
 \r
 namespace cln {\r
 \r
-static const cl_I digits_to_I_base2 (const char * MSBptr, uintL len, uintD base)\r
+static const cl_I digits_to_I_base2 (const char * MSBptr, uintC len, uintD base)\r
 {\r
        // base is a power of two: write the digits from least significant\r
        // to most significant into the result NUDS. Result needs\r
@@ -58,7 +58,7 @@ static const cl_I digits_to_I_base2 (const char * MSBptr, uintL len, uintD base)
        return NUDS_to_I(erg_MSDptr,erg_len);\r
 }\r
 \r
-static const cl_I digits_to_I_baseN (const char * MSBptr, uintL len, uintD base)\r
+static const cl_I digits_to_I_baseN (const char * MSBptr, uintC len, uintD base)\r
 {\r
        // base is not a power of two: Add digits one by one. Result nees\r
        // 1+ceiling(len*log(base)/(intDsize*log(2))) or some more digits.\r
@@ -66,7 +66,7 @@ static const cl_I digits_to_I_baseN (const char * MSBptr, uintL len, uintD base)
        var uintD* erg_MSDptr;\r
        var uintC erg_len;\r
        var uintD* erg_LSDptr;\r
-       var uintL need = 1+floor(len,intDsize*256); // > len/(intDsize*256) >=0\r
+       var uintC need = 1+floor(len,intDsize*256); // > len/(intDsize*256) >=0\r
        switch (base) { // multiply need with ceiling(256*log(base)/log(2)):\r
                case 2: need = 256*need; break;\r
                case 3: need = 406*need; break;\r
@@ -142,7 +142,7 @@ static const cl_I digits_to_I_baseN (const char * MSBptr, uintL len, uintD base)
        return NUDS_to_I(erg_MSDptr,erg_len);\r
 }\r
 \r
-const cl_I digits_to_I (const char * MSBptr, uintL len, uintD base)\r
+const cl_I digits_to_I (const char * MSBptr, uintC len, uintD base)\r
 {\r
        if ((base & (base-1)) == 0) {\r
                return digits_to_I_base2(MSBptr, len, base);\r
index abe48b94f1467873df3bd793a8c3011f8eaf81d6..b5d8a849e5b36a4cdb3939e6fbb2801553e4440b 100644 (file)
@@ -46,11 +46,11 @@ namespace cln {
   const int cl_digits_algo = 1;
 
 // like I_to_digits, except that the result has exactly erg_len characters.
-static inline void I_to_digits_noshrink (const cl_I& X, uintD base, uintL erg_len, cl_digits* erg)
+static inline void I_to_digits_noshrink (const cl_I& X, uintD base, uintC erg_len, cl_digits* erg)
 {
   I_to_digits(X,base,erg);
   if (erg->len > erg_len) cl_abort();
-  var uintL count = erg_len - erg->len;
+  var uintC count = erg_len - erg->len;
   if (count > 0)
     { var uintB* ptr = erg->MSBptr;
       do { *--ptr = '0'; } while (--count > 0);
@@ -159,9 +159,9 @@ void I_to_digits (const cl_I& X, uintD base, cl_digits* erg)
           // for k*2^i characters, convert X1 to string. (Have to convert
           // X0 first because the conversion may temporarily prepend some
           // zero characters.)
-          var uintL ilen_X = integer_length(X);
+          var uintC ilen_X = integer_length(X);
           var const cached_power_table_entry * p;
-          var uintL ilen_B;
+          var uintC ilen_B;
           var uintL i;
           for (i = 0; ; i++)
             { p = cached_power(base,i);
index 30b5c5827528ecb6f4ac865024c5bbe2138034e9..357fccfd3c3dbc159baab6d05fcba0265d6cd212 100644 (file)
@@ -324,7 +324,7 @@ namespace cln {
       {var uintD* divroomptr; // Platz für Divisionsergebnis
        var uintD* c_LSDptr;
        var uintD* d_LSDptr;
-       {var uintL c_len = (uintL)(a_len>=b_len ? a_len : b_len) + 1;
+       {var uintC c_len = (a_len>=b_len ? a_len : b_len) + 1;
         num_stack_alloc(c_len,divroomptr=,c_LSDptr=);
         num_stack_alloc(c_len,,d_LSDptr=);
         // Jetzt ist ../c_len/c_LSDptr, ../c_len/d_LSDptr frei.
index d99272ac5cc8eb8037629288e5a2a101052aaf5c..b8618de5c2745c4b859bb41eff16010dc338cfe9 100644 (file)
@@ -279,7 +279,7 @@ namespace cln {
        //           uBb = uBb.MSDptr/uBb.len/uBb.LSDptr,
        // alles NUDS.
        // Platz für zwei Rechenregister besorgen, mit je max(a_len,b_len)+1 Digits:
-       {var uintL c_len = (uintL)(a_len>=b_len ? a_len : b_len) + 1;
+       {var uintC c_len = (a_len>=b_len ? a_len : b_len) + 1;
         num_stack_alloc(c_len,,c_LSDptr=);
         num_stack_alloc(c_len,divroomptr=,d_LSDptr=);
         // Jetzt ist ../c_len/c_LSDptr, ../c_len/d_LSDptr frei.
index 5c790d0167bfa1a2ecf06d9b2a1dfaa5d9fc0b5a..572be443a881660143442b78846897cd6788d16b 100644 (file)
@@ -63,7 +63,7 @@ inline uint32 equal_hashcode (const cl_BN& x)
        } else {
                sign = 0;
        }
-       var sintL exp = (uintL)len * intDsize;
+       var sintC exp = len * intDsize;
        // Nicht alle führenden 65 Bits sind =0.
        if (msd==0) {
                msd = msd2;
@@ -108,7 +108,7 @@ inline uint32 equal_hashcode (const cl_BN& x)
        } else {
                sign = 0;
        }
-       var sintL exp = (uintL)len * intDsize;
+       var sintC exp = len * intDsize;
        // Nicht alle führenden intDsize+1 Bits sind =0.
        // Wegen intDsize<=32: Nicht alle führenden 33 Bits sind =0.
        if (msd==0) {
index f9beb78da84fc6e4c66f4bf13c45fffc025935e0..46a7977342692c2d85fc7f7a8b5a413ff23d0091 100644 (file)
@@ -28,7 +28,7 @@ namespace cln {
 //   (ord2 x) = intDsize * Anzahl der Nulldigits am Schluß
 //              + Anzahl der Nullbits am Ende des letzten Digits /=0.
 
-uintL ord2 (const cl_I& x) // x /= 0
+uintC ord2 (const cl_I& x) // x /= 0
 {
        if (fixnump(x))
          { var uintV x_ = FN_to_V(x); // x als intVsize-Bit-Zahl
@@ -40,7 +40,7 @@ uintL ord2 (const cl_I& x) // x /= 0
             #endif
          }
          else
-         { var uintL bitcount = 0;
+         { var uintC bitcount = 0;
            var const uintD* ptr;
            BN_to_NDS_nocopy(x, ,,ptr=); // normalisierte DS zu x bilden.
            while (lspref(ptr,0) == 0) { lsshrink(ptr); bitcount += intDsize; } // Nulldigits abzählen
index df0f7604e47779b79bec3ae2f7d5588e6f5a35bc..dc29c24d8eda6ec66f7f4d0ba3bdb2dccbb93698 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace cln {
 
-uintL power2p (const cl_I& x) // x > 0
+uintC power2p (const cl_I& x) // x > 0
 {
 // Methode 1: Wenn ord2(x) = integer_length(x)-1.
 // Methode 2: Wenn logand(x,x-1) = 0.
@@ -41,7 +41,7 @@ uintL power2p (const cl_I& x) // x > 0
            if (DS_test_loop(MSDptr mspop 1,len-1,LSDptr)) return 0; // danach alles Nullen
           {var uintL msdlen;
            integerlengthD(msd, msdlen=);
-           return intDsize*(uintL)(len-1) + msdlen; // integer_length(x) als Ergebnis
+           return intDsize*(len-1) + msdlen; // integer_length(x) als Ergebnis
          }}
 }
 
index 26f9b686a69cb9cefbdb4eecd718d877503725be..14f82363b669830bf2cf00854164efa0a4bc890e 100644 (file)
@@ -18,7 +18,7 @@ namespace cln {
 char * cl_decimal_string (const cl_I& x)
 {
        CL_ALLOCA_STACK;
-       var uintL need = cl_digits_need(x,10);
+       var uintC need = cl_digits_need(x,10);
        var uintB* ziffern = cl_alloc_array(uintB,need); // Platz für die Ziffern
        var cl_digits erg; erg.LSBptr = &ziffern[need];
        I_to_digits(x,10,&erg); // Umwandlung in Ziffern
index 65688b45fa22c22ff1d849bef7e68a297df573fd..b8447f97896549d0f76dad6bcefb0a4ca57ca2d1 100644 (file)
@@ -25,14 +25,14 @@ void print_integer (std::ostream& stream, unsigned int base, const cl_I& z)
        } else
                abs_z = z;
        CL_ALLOCA_STACK;
-       var uintL need = cl_digits_need(abs_z,base);
+       var uintC need = cl_digits_need(abs_z,base);
        var uintB* ziffern = cl_alloc_array(uintB,need); // Platz für die Ziffern
        var cl_digits erg; erg.LSBptr = &ziffern[need];
        I_to_digits(abs_z,(uintD)base,&erg); // Umwandlung in Ziffern
        // Ziffern ausgeben:
        {
                var uintB* ptr = erg.MSBptr;
-               var uintL count = erg.len;
+               var uintC count = erg.len;
                do { fprintchar(stream,*ptr++); } until (--count==0);
        }
 }
index b6cb46582b64e344699d12bbb6445ba98c5abc1e..49391e210a31b22cebcaa876f6392e02bb163efc 100644 (file)
@@ -26,7 +26,7 @@ char * print_integer_to_string (unsigned int base, const cl_I& z)
        } else
                abs_z = z;
        CL_ALLOCA_STACK;
-       var uintL need = 1+cl_digits_need(abs_z,base);
+       var uintC need = 1+cl_digits_need(abs_z,base);
        var uintB* ziffern = cl_alloc_array(uintB,need); // Platz für die Ziffern
        var cl_digits erg; erg.LSBptr = &ziffern[need];
        I_to_digits(abs_z,(uintD)base,&erg); // Umwandlung in Ziffern
index a15b2c35c2f2d20623c7f8d99652450bb84860db..297718d2eece729e2611d4d275b5e7a9634df87c 100644 (file)
@@ -44,13 +44,13 @@ cl_heap_modint_ring::cl_heap_modint_ring (cl_I m, cl_modint_setops* setopv, cl_m
        type = &cl_class_modint_ring;
        if (minusp(m)) cl_abort();
        if (!cln::zerop(m)) {
-               var uintL b = integer_length(m-1);
+               var uintC b = integer_length(m-1);
                // m <= 2^b, hence one needs b bits for a representative mod m.
                if (b <= 1) {
                        log2_bits = 0; bits = 1;
                } else if (b <= cl_word_size) {
                        var uintL bb;
-                       integerlength32(b-1,bb=); // b <= 2^bb with bb minimal
+                       integerlengthC(b-1,bb=); // b <= 2^bb with bb minimal
                        log2_bits = bb; bits = 1<<bb;
                } else {
                        log2_bits = -1; bits = -1;
@@ -90,13 +90,13 @@ static inline cl_heap_modint_ring* make_modint_ring (const cl_I& m) // m >= 0
                return new cl_heap_modint_ring_int();
        // Now m > 0.
        {
-               var uintL log2_m = power2p(m);
+               var uintC log2_m = power2p(m);
                if (log2_m)
                        return new cl_heap_modint_ring_pow2(m,log2_m-1);
        }
        // Now m > 1.
        {
-               var uintL log2_m = integer_length(m); // = integerlength(m-1)
+               var uintC log2_m = integer_length(m); // = integerlength(m-1)
                if (log2_m < 16) // m < 0x10000
                        return new cl_heap_modint_ring_fix16(m);
                #if (cl_value_len <= 32)
@@ -110,12 +110,12 @@ static inline cl_heap_modint_ring* make_modint_ring (const cl_I& m) // m >= 0
                #endif
        }
        {
-               var uintL m1 = power2p(m+1);
+               var uintC m1 = power2p(m+1);
                if (m1)
                        return new cl_heap_modint_ring_pow2m1(m,m1-1);
        }
        {
-               var uintL m1 = power2p(m-1);
+               var uintC m1 = power2p(m-1);
                if (m1)
                        return new cl_heap_modint_ring_pow2p1(m,m1-1);
        }
index 7f501b5328a3e6fff86b85dca5d2ba35df7da082..9c8146e5b03d7b44333252b4842824b4c1612669 100644 (file)
@@ -13,7 +13,7 @@
 
 namespace cln {
 
-const cl_MI operator<< (const cl_MI& x, sintL y) // assume 0 <= y < 2^31
+const cl_MI operator<< (const cl_MI& x, sintC y) // assume 0 <= y < 2^(intCsize-1)
 {
        if (y == 0)
                return x;
index 06222ee24da135e65670b051abdb173e9e0dc20b..c5c7a4cc1f02f13e87d50c42d105e6af172c0757 100644 (file)
@@ -179,7 +179,7 @@ static cl_heap_modint_ring* try_make_modint_ring_montgom (const cl_I& M)
 {
        if (!oddp(M))
                return NULL;
-       var uintL m = integer_length(M);
+       var uintC m = integer_length(M);
        CL_ALLOCA_STACK;
        var uintC len;
        var const uintD* M_LSDptr;
@@ -191,9 +191,9 @@ static cl_heap_modint_ring* try_make_modint_ring_montgom (const cl_I& M)
        recip2adic(len,M_LSDptr,U_LSDptr);
        // Look at U's bits.
        #define U_bit(i) (lspref(U_LSDptr,floor(i,intDsize)) & ((uintD)1 << ((i)%intDsize)))
-       var uintL i_min;
-       var uintL i_max;
-       var uintL i = floor(m,2);
+       var uintC i_min;
+       var uintC i_max;
+       var uintC i = floor(m,2);
        var cl_boolean negative;
        if (U_bit(i)) {
                for (; --i > 0; )
@@ -218,7 +218,7 @@ static cl_heap_modint_ring* try_make_modint_ring_montgom (const cl_I& M)
        // OK, all the bits i_max-1..i_min of U are equal.
        if (i_max - i_min <= floor(m,2))
                return NULL;
-       var uintL n = i_max;
+       var uintC n = i_max;
        // Turn U (mod 2^n) into a signed integer.
        if (n % intDsize) {
                if (negative)
@@ -226,7 +226,7 @@ static cl_heap_modint_ring* try_make_modint_ring_montgom (const cl_I& M)
                else
                        lspref(U_LSDptr,floor(n,intDsize)) &= ((uintD)1 << (n % intDsize)) - 1;
        }
-       var uintL U_len = ceiling(n,intDsize);
+       var uintC U_len = ceiling(n,intDsize);
        var cl_I U = DS_to_I(U_LSDptr lspop U_len,U_len);
        var cl_I V_N = 1 - U*M;
        if (ldb_test(V_N,cl_byte(n,0)))
index 6746899cbf557d63d9bde52ea4e81d616011c39c..8511600a874c88b9ebd11149225c421ba0f626e7 100644 (file)
@@ -6,11 +6,11 @@ class cl_heap_modint_ring_pow2 : public cl_heap_modint_ring {
        SUBCLASS_cl_heap_modint_ring()
 public:
        // Constructor.
-       cl_heap_modint_ring_pow2 (const cl_I& m, uintL m1); // m = 2^m1
+       cl_heap_modint_ring_pow2 (const cl_I& m, uintC m1); // m = 2^m1
        // Destructor.
        ~cl_heap_modint_ring_pow2 () {}
        // Additional information.
-       uintL m1;
+       uintC m1;
 };
 
 static inline const cl_I pow2_reduce_modulo (cl_heap_modint_ring* _R, const cl_I& x)
@@ -148,7 +148,7 @@ cl_class cl_class_modint_ring_pow2 = {
 };
 
 // Constructor.
-inline cl_heap_modint_ring_pow2::cl_heap_modint_ring_pow2 (const cl_I& m, uintL _m1)
+inline cl_heap_modint_ring_pow2::cl_heap_modint_ring_pow2 (const cl_I& m, uintC _m1)
        : cl_heap_modint_ring (m, &std_setops, &pow2_addops, &pow2_mulops), m1 (_m1)
 {
        type = &cl_class_modint_ring_pow2;
index 2a36cfe0f4d137ea67824902df8f87d391d8588f..9daecad99a7abeaf4809b602c612004343e1a4fa 100644 (file)
@@ -6,11 +6,11 @@ class cl_heap_modint_ring_pow2m1 : public cl_heap_modint_ring {
        SUBCLASS_cl_heap_modint_ring()
 public:
        // Constructor.
-       cl_heap_modint_ring_pow2m1 (const cl_I& m, uintL m1); // m = 2^m1 - 1
+       cl_heap_modint_ring_pow2m1 (const cl_I& m, uintC m1); // m = 2^m1 - 1
        // Destructor.
        ~cl_heap_modint_ring_pow2m1 () {}
        // Additional information.
-       uintL m1;
+       uintC m1;
 };
 
 static inline const cl_I pow2m1_reduce_modulo (cl_heap_modint_ring* _R, const cl_I& x)
@@ -24,13 +24,13 @@ static inline const cl_I pow2m1_reduce_modulo (cl_heap_modint_ring* _R, const cl
  {     Mutable(cl_I,x);
        var cl_boolean sign = minusp(x);
        if (sign) { x = lognot(x); }
-       var const uintL m1 = R->m1;
+       var const uintC m1 = R->m1;
        if (x >= R->modulus) {
                x = plus1(x); // avoid staying at x = m
                do {
-                       var uintL xlen = integer_length(x);
+                       var uintC xlen = integer_length(x);
                        var cl_I y = ldb(x,cl_byte(m1,0));
-                       for (var uintL i = m1; i < xlen; i += m1)
+                       for (var uintC i = m1; i < xlen; i += m1)
                                y = y + ldb(x,cl_byte(m1,i));
                        x = y;
                } while (x > R->modulus);
@@ -49,7 +49,7 @@ static const _cl_MI pow2m1_canonhom (cl_heap_modint_ring* R, const cl_I& x)
 static const _cl_MI pow2m1_mul (cl_heap_modint_ring* _R, const _cl_MI& x, const _cl_MI& y)
 {
        var cl_heap_modint_ring_pow2m1* R = (cl_heap_modint_ring_pow2m1*)_R;
-       var const uintL m1 = R->m1;
+       var const uintC m1 = R->m1;
        var cl_I zr = x.rep * y.rep;
        zr = ldb(zr,cl_byte(m1,m1)) + ldb(zr,cl_byte(m1,0));
        return _cl_MI(R, zr >= R->modulus ? zr - R->modulus : zr);
@@ -58,7 +58,7 @@ static const _cl_MI pow2m1_mul (cl_heap_modint_ring* _R, const _cl_MI& x, const
 static const _cl_MI pow2m1_square (cl_heap_modint_ring* _R, const _cl_MI& x)
 {
        var cl_heap_modint_ring_pow2m1* R = (cl_heap_modint_ring_pow2m1*)_R;
-       var const uintL m1 = R->m1;
+       var const uintC m1 = R->m1;
        var cl_I zr = square(x.rep);
        zr = ldb(zr,cl_byte(m1,m1)) + ldb(zr,cl_byte(m1,0));
        return _cl_MI(R, zr >= R->modulus ? zr - R->modulus : zr);
@@ -89,7 +89,7 @@ cl_class cl_class_modint_ring_pow2m1 = {
 };
 
 // Constructor.
-inline cl_heap_modint_ring_pow2m1::cl_heap_modint_ring_pow2m1 (const cl_I& m, uintL _m1)
+inline cl_heap_modint_ring_pow2m1::cl_heap_modint_ring_pow2m1 (const cl_I& m, uintC _m1)
        : cl_heap_modint_ring (m, &std_setops, &pow2m1_addops, &pow2m1_mulops), m1 (_m1)
 {
        type = &cl_class_modint_ring_pow2m1;
index 06477c815201df4d0a2ee9bdf97b284206d297fb..cd5a180583da97d6268dca3f820ce646b4a49bb6 100644 (file)
@@ -6,11 +6,11 @@ class cl_heap_modint_ring_pow2p1 : public cl_heap_modint_ring {
        SUBCLASS_cl_heap_modint_ring()
 public:
        // Constructor.
-       cl_heap_modint_ring_pow2p1 (const cl_I& m, uintL m1); // m = 2^m1 + 1
+       cl_heap_modint_ring_pow2p1 (const cl_I& m, uintC m1); // m = 2^m1 + 1
        // Destructor.
        ~cl_heap_modint_ring_pow2p1 () {}
        // Additional information.
-       uintL m1;
+       uintC m1;
 };
 
 static inline const cl_I pow2p1_reduce_modulo (cl_heap_modint_ring* _R, const cl_I& x)
@@ -24,11 +24,11 @@ static inline const cl_I pow2p1_reduce_modulo (cl_heap_modint_ring* _R, const cl
  {     Mutable(cl_I,x);
        var bool sign = minusp(x);
        if (sign) { x = lognot(x); }
-       var const uintL m1 = R->m1;
+       var const uintC m1 = R->m1;
        while (x >= R->modulus) {
-               var uintL xlen = integer_length(x);
+               var uintC xlen = integer_length(x);
                var cl_I y = ldb(x,cl_byte(m1,0));
-               for (var uintL i = m1; ; ) {
+               for (var uintC i = m1; ; ) {
                        y = y - ldb(x,cl_byte(m1,i));
                        i += m1;
                        if (i >= xlen)
@@ -56,7 +56,7 @@ static const _cl_MI pow2p1_canonhom (cl_heap_modint_ring* R, const cl_I& x)
 static const _cl_MI pow2p1_mul (cl_heap_modint_ring* _R, const _cl_MI& x, const _cl_MI& y)
 {
        var cl_heap_modint_ring_pow2p1* R = (cl_heap_modint_ring_pow2p1*)_R;
-       var const uintL m1 = R->m1;
+       var const uintC m1 = R->m1;
        var cl_I zr = x.rep * y.rep;
        // Now 0 <= zr <= 2^(2*m1).
        zr = ldb(zr,cl_byte(1,2*m1)) - ldb(zr,cl_byte(m1,m1)) + ldb(zr,cl_byte(m1,0));
@@ -67,7 +67,7 @@ static const _cl_MI pow2p1_mul (cl_heap_modint_ring* _R, const _cl_MI& x, const
 static const _cl_MI pow2p1_square (cl_heap_modint_ring* _R, const _cl_MI& x)
 {
        var cl_heap_modint_ring_pow2p1* R = (cl_heap_modint_ring_pow2p1*)_R;
-       var const uintL m1 = R->m1;
+       var const uintC m1 = R->m1;
        var cl_I zr = square(x.rep);
        // Now 0 <= zr <= 2^(2*m1).
        zr = ldb(zr,cl_byte(1,2*m1)) - ldb(zr,cl_byte(m1,m1)) + ldb(zr,cl_byte(m1,0));
@@ -100,7 +100,7 @@ cl_class cl_class_modint_ring_pow2p1 = {
 };
 
 // Constructor.
-inline cl_heap_modint_ring_pow2p1::cl_heap_modint_ring_pow2p1 (const cl_I& m, uintL _m1)
+inline cl_heap_modint_ring_pow2p1::cl_heap_modint_ring_pow2p1 (const cl_I& m, uintC _m1)
        : cl_heap_modint_ring (m, &std_setops, &pow2p1_addops, &pow2p1_mulops), m1 (_m1)
 {
        type = &cl_class_modint_ring_pow2p1;
index ca975e37d8d9bb7c7d42242aef5025fe5912fe4e..957d170836e0f51a75b655bf93866512814c842e 100644 (file)
@@ -15,7 +15,7 @@
 
 namespace cln {
 
-const cl_MI operator>> (const cl_MI& x, sintL y) // assume 0 <= y < 2^31
+const cl_MI operator>> (const cl_MI& x, sintC y) // assume 0 <= y < 2^(intCsize-1)
 {
        if (y == 0)
                return x;
index 9ec969478c929343ac135c2444a76db86ff8c055..04fd37bb0c84457d439ce68b5c7e3b7431ddd57d 100644 (file)
@@ -171,7 +171,7 @@ static const _cl_MI std_expt_pos (cl_heap_modint_ring* R, const _cl_MI& x, const
        //   k = 3 for nn <= 69.8
        //   ... k for nn <= k*(k+1)*2^(2k)/(2^(k+1)-k-2)
        var cl_I n = y;
-       var uintL nn = integer_length(n);
+       var uintC nn = integer_length(n);
        // n has nn bits.
        if (nn <= 8) {
                // k = 1, normal Left-Right Binary algorithm.
@@ -202,7 +202,7 @@ static const _cl_MI std_expt_pos (cl_heap_modint_ring* R, const _cl_MI& x, const
                else if (nn <= 1721160) k = 14;
                else if (nn <= 3933180) k = 15;
                else /* if (nn <= 8914120) */ k = 16;
-               var uintL nnk = ceiling(nn,k); // number of base-2^k digits in n
+               var uintC nnk = ceiling(nn,k); // number of base-2^k digits in n
                var uint16* n_digits = cl_alloc_array(uint16,nnk);
                // Split n into base-2^k digits.
                {
@@ -212,7 +212,7 @@ static const _cl_MI std_expt_pos (cl_heap_modint_ring* R, const _cl_MI& x, const
                        var const uintL k_mask = bit(k)-1;
                        var uintD carry = 0;
                        var unsigned int carrybits = 0;
-                       for (var uintL i = 0; i < nnk; i++) {
+                       for (var uintC i = 0; i < nnk; i++) {
                                if (carrybits >= k) {
                                        n_digits[i] = carry & k_mask;
                                        carry = carry >> k;
@@ -229,7 +229,7 @@ static const _cl_MI std_expt_pos (cl_heap_modint_ring* R, const _cl_MI& x, const
                // Compute maximum odd base-2^k digit.
                var uintL maxodd = 1;
                if (k <= 8) {
-                       for (var uintL i = 0; i < nnk; i++) {
+                       for (var uintC i = 0; i < nnk; i++) {
                                var uintL d = n_digits[i];
                                if (d > 0) {
                                        d = odd_table[d];
@@ -237,7 +237,7 @@ static const _cl_MI std_expt_pos (cl_heap_modint_ring* R, const _cl_MI& x, const
                                }
                        }
                } else {
-                       for (var uintL i = 0; i < nnk; i++) {
+                       for (var uintC i = 0; i < nnk; i++) {
                                var uintL d = n_digits[i];
                                if (d > 0) {
                                        var uintL d2; ord2_32(d,d2=);
@@ -275,7 +275,7 @@ static const _cl_MI std_expt_pos (cl_heap_modint_ring* R, const _cl_MI& x, const
                        for ( ; d2>0; d2--)
                                a = R->_square(a);
                }
-               for (var sintL i = nnk-2; i >= 0; i--) {
+               for (var sintC i = nnk-2; i >= 0; i--) {
                        // Compute a := a^(2^k) * x^n_digits[i].
                        var uintL d = n_digits[i];
                        var uintL d2;
index b720419ef8605dcae2cbd7d3d8b2d8a30584b3f0..cd8b7736dbdb6042a7cff02073bc6c8c2fa8acf0 100644 (file)
@@ -18,7 +18,7 @@ cl_boolean cl_miller_rabin_test (const cl_I& n, int count, cl_I* factor)
        // [Cohen], section 8.2, algorithm 8.2.2.
        var cl_modint_ring R = find_modint_ring(n); // Z/nZ
        var cl_I m = n-1;
-       var uintL e = ord2(m);
+       var uintC e = ord2(m);
        m = m>>e;
        // n-1 = 2^e*m
        var cl_MI one = R->one();
@@ -37,7 +37,7 @@ cl_boolean cl_miller_rabin_test (const cl_I& n, int count, cl_I* factor)
                var cl_MI b = R->expt_pos(a,m); // b = a^m
                if (b == one)
                        goto passed;
-               for (uintL s = e; s > 0; s--) {
+               for (uintC s = e; s > 0; s--) {
                        if (b == minusone)
                                goto passed;
                        var cl_MI new_b = R->square(b);
index 3b79d2f7343c1afb295bfc25c786a35487e12cc1..a761cf97e8a25b153c6973bd1fd213752609318a 100644 (file)
@@ -23,7 +23,7 @@ cl_boolean isprobprime (const cl_I& n)
        var int count = 50;
        // Step 1: Trial division (rules out 87% of all numbers quickly).
        const uint32 trialdivide_limit = 70;
-       var uintL l = integer_length(n);
+       var uintC l = integer_length(n);
        if (l <= 32) {
                var uint32 nn = cl_I_to_UL(n);
                if (nn <= cl_small_prime_table_limit) {
index 8208b6d80ce6c274a876483f7a4a80cde3cda174..3b95574e2bd5dc14cdb6a0aa1098f52b58aba363 100644 (file)
@@ -209,11 +209,11 @@ static const sqrt_mod_p_t tonelli_shanks_sqrt (const cl_modint_ring& R, const cl
        // take h in G_(j+1) \ G_j, so that h^2 in G_j \ G_(j-1), and
        // a^-1*b^2*h^2 is in G_(j-1). So multiply b with h.
        var cl_I& p = R->modulus;
-       var uintL e = ord2(p-1);
+       var uintC e = ord2(p-1);
        var cl_I m = (p-1) >> e;
        // p-1 = 2^e*m, m odd.
        // We will have the invariant c = a^-1*b^2 in G/G_j.
-       var uintL j = e;
+       var uintC j = e;
        // Initialize b = a^((m+1)/2), c = a^m, but avoid to divide by a.
        var cl_MI c = R->expt_pos(a,(m-1)>>1);
        var cl_MI b = R->mul(a,c);
@@ -248,7 +248,7 @@ static const sqrt_mod_p_t tonelli_shanks_sqrt (const cl_modint_ring& R, const cl
        do {
                // Now c = a^-1*b^2 in G_j, h in G_j \ G_(j-1).
                // Determine the smallest i such that c in G_i.
-               var uintL i = 0;
+               var uintC i = 0;
                var cl_MI ci = c; // c_i = c^(2^i)
                for ( ; i < j; i++, ci = R->square(ci))
                        if (ci == R->one())
@@ -259,7 +259,7 @@ static const sqrt_mod_p_t tonelli_shanks_sqrt (const cl_modint_ring& R, const cl
                        // Indicates that p is not prime.
                        return new cl_composite_condition(p);
                // OK, i < j.
-               for (var uintL count = j-i-1; count > 0; count--)
+               for (var uintC count = j-i-1; count > 0; count--)
                        h = R->square(h);
                // Now h in G_(i+1) \ G_i.
                b = R->mul(b,h);
@@ -312,8 +312,8 @@ const sqrt_mod_p_t sqrt_mod_p (const cl_modint_ring& R, const cl_MI& a)
                else
                        return sqrt_mod_p_t(2,R->canonhom(x1),R->canonhom(x2));
        }
-       var uintL l = integer_length(p);
-       var uintL e = ord2(p-1);
+       var uintC l = integer_length(p);
+       var uintC e = ord2(p-1);
        //if (e > 30 && e > l/(::log((double)l)*0.72-1))
        if (e > 30 && e > l/(::log((double)l)*0.92-2.41))
                // Algorithm 2.
index 2011b34aacea68c7fb3aaafb9be936c9f089d182..fa2c5b123fc9f668ae5e1d0d84554d27af3be4fb 100644 (file)
@@ -992,7 +992,7 @@ static const cl_ring_element gf2_eval (cl_heap_univpoly_ring* UPR, const _cl_UP&
                return cl_MI(R, x[0]);
        else {
                var uintL count = ceiling(len,intDsize);
-               var uintL bitcount = 0;
+               var uintC bitcount = 0;
                do {
                        count--;
                        bitcount += logcountD(xv->data[count]);
index a88e05e0fbd3102242105b076c5eba97d10a9d35..4be26ea418084dac36a86f1bf7b27e2973ba5081 100644 (file)
@@ -17,7 +17,7 @@ namespace cln {
 
 const cl_F cl_float (const cl_R& x, float_format_t f)
 {
-       floatformatcase((uintL)f
+       floatformatcase((uintC)f
        ,       return cl_R_to_SF(x);
        ,       return cl_R_to_FF(x);
        ,       return cl_R_to_DF(x);
index fc98ae877ad055668d16b68a663718a7e5a6b17d..caabb20d704b2b622973d5de09bbd90d541ae014 100644 (file)
@@ -65,7 +65,7 @@ const digits_with_dot format_float_to_string (const cl_F& arg, const sintL width
        var cl_idecoded_float decoded = integer_decode_float(arg);
        var const cl_I& significand = decoded.mantissa;
        var const cl_I& expon = decoded.exponent;
-       var uintL mantprec = float_digits(arg)-1;
+       var uintC mantprec = float_digits(arg)-1;
        var cl_I numerator = significand;
        var cl_I denominator = 1;
        var cl_I abrund_einh = 1; // Abrundungseinheit:
index b9c3ddadac4e2679e34e95b75645fc8d213d3888..d31cf69b0720bc4abebdfdd113a2fdf68f844f42 100644 (file)
@@ -220,9 +220,9 @@ not_rational_syntax:
                        ptr_after_prec = skip_digits(ptr,string_limit,10);
                        if (ptr_after_prec == ptr) goto not_float_syntax;
                        var cl_I prec1 = digits_to_I(ptr,ptr_after_prec-ptr,10);
-                       var uintL prec2 = cl_I_to_UL(prec1);
+                       var uintC prec2 = cl_I_to_ulong(prec1);
                        prec = (float_base==10 ? float_format(prec2)
-                                              : (float_format_t)((uintL)((1+prec2)*::log((double)float_base)*1.442695041)+1)
+                                              : (float_format_t)((uintC)((1+prec2)*::log((double)float_base)*1.442695041)+1)
                               );
                } else {
                        switch (exponent_marker) {
@@ -237,14 +237,14 @@ not_rational_syntax:
                                // Count the number of significant digits.
                                ptr = ptr_after_sign;
                                while (ptr < ptr_after_fracpart && (*ptr == '0' || *ptr == '.')) ptr++;
-                               var uintL num_significant_digits =
+                               var uintC num_significant_digits =
                                  (ptr_after_fracpart - ptr) - (ptr_before_fracpart > ptr ? 1 : 0);
-                               var uintL prec2 = (num_significant_digits>=2 ? num_significant_digits-2 : 0);
+                               var uintC prec2 = (num_significant_digits>=2 ? num_significant_digits-2 : 0);
                                var float_format_t precx =
                                  (float_base==10 ? float_format(prec2)
-                                                 : (float_format_t)((uintL)((1+prec2)*::log((double)float_base)*1.442695041)+1)
+                                                 : (float_format_t)((uintC)((1+prec2)*::log((double)float_base)*1.442695041)+1)
                                  );
-                               if ((uintL)precx > (uintL)prec)
+                               if ((uintC)precx > (uintC)prec)
                                        prec = precx;
                        }
                }
index 7fdcd81ffce392b52f1496042af76d7422495a16..1471cefe903519148894011070bda1135817a804 100644 (file)
@@ -56,7 +56,7 @@ static inline const cl_heap_GV_I * outcast (const cl_GV_inner<cl_I>* vec)
 
 struct cl_GV_I_vectorops {
        cl_GV_vectorops<cl_I> ops;
-       sintL m; // for maxbits
+       sintC m; // for maxbits
 };
 
 static inline cl_GV_I_vectorops* outcast (cl_GV_vectorops<cl_I>* vectorops)
@@ -77,12 +77,12 @@ struct cl_heap_GV_I_general : public cl_heap_GV_I {
        cl_heap_GV_I_general ();
 };
 
-static const cl_I general_element (const cl_GV_inner<cl_I>* vec, uintL index)
+static const cl_I general_element (const cl_GV_inner<cl_I>* vec, uintC index)
 {
        return ((const cl_heap_GV_I_general *) outcast(vec))->data[index];
 }
 
-static void general_set_element (cl_GV_inner<cl_I>* vec, uintL index, const cl_I& x)
+static void general_set_element (cl_GV_inner<cl_I>* vec, uintC index, const cl_I& x)
 {
        ((cl_heap_GV_I_general *) outcast(vec))->data[index] = x;
 }
@@ -90,20 +90,20 @@ static void general_set_element (cl_GV_inner<cl_I>* vec, uintL index, const cl_I
 static void general_do_delete (cl_GV_inner<cl_I>* vec)
 {
        var cl_heap_GV_I_general* hv = (cl_heap_GV_I_general *) outcast(vec);
-       var uintL len = hv->v.length();
-       for (var uintL i = 0; i < len; i++)
+       var uintC len = hv->v.length();
+       for (var uintC i = 0; i < len; i++)
                hv->data[i].~cl_I();
 }
 
-static void general_copy_elements (const cl_GV_inner<cl_I>* srcvec, uintL srcindex, cl_GV_inner<cl_I>* destvec, uintL destindex, uintL count)
+static void general_copy_elements (const cl_GV_inner<cl_I>* srcvec, uintC srcindex, cl_GV_inner<cl_I>* destvec, uintC destindex, uintC count)
 {
        if (count > 0) {
                var const cl_heap_GV_I_general* srcv =
                  (const cl_heap_GV_I_general *) outcast(srcvec);
                var cl_heap_GV_I_general* destv =
                  (cl_heap_GV_I_general *) outcast(destvec);
-               var uintL srclen = srcv->v.length();
-               var uintL destlen = destv->v.length();
+               var uintC srclen = srcv->v.length();
+               var uintC destlen = destv->v.length();
                if (!(srcindex <= srcindex+count && srcindex+count <= srclen))
                        cl_abort();
                if (!(destindex <= destindex+count && destindex+count <= destlen))
@@ -122,13 +122,13 @@ static cl_GV_I_vectorops general_vectorops = {{
        -1
 };
 
-cl_heap_GV_I* cl_make_heap_GV_I (uintL len)
+cl_heap_GV_I* cl_make_heap_GV_I (uintC len)
 {
        var cl_heap_GV_I_general* hv = (cl_heap_GV_I_general*) malloc_hook(offsetofa(cl_heap_GV_I_general,data)+sizeof(cl_I)*len);
        hv->refcount = 1;
        hv->type = &cl_class_gvector_integer;
        new (&hv->v) cl_GV_inner<cl_I> (len,&general_vectorops.ops);
-       for (var uintL i = 0; i < len; i++)
+       for (var uintC i = 0; i < len; i++)
                init1(cl_I, hv->data[i]) ();
        return hv;
 }
@@ -146,17 +146,17 @@ struct cl_heap_GV_I_bits##m : public cl_heap_GV_I {                       \
        /* No default constructor. */                                   \
        cl_heap_GV_I_bits##m ();                                        \
 };                                                                     \
-static const cl_I bits##m##_element (const cl_GV_inner<cl_I>* vec, uintL index); \
-static void bits##m##_set_element (cl_GV_inner<cl_I>* vec, uintL index, const cl_I& x); \
-static void bits##m##_copy_elements (const cl_GV_inner<cl_I>* srcvec, uintL srcindex, cl_GV_inner<cl_I>* destvec, uintL destindex, uintL count) \
+static const cl_I bits##m##_element (const cl_GV_inner<cl_I>* vec, uintC index); \
+static void bits##m##_set_element (cl_GV_inner<cl_I>* vec, uintC index, const cl_I& x); \
+static void bits##m##_copy_elements (const cl_GV_inner<cl_I>* srcvec, uintC srcindex, cl_GV_inner<cl_I>* destvec, uintC destindex, uintC count) \
 {                                                                              \
        if (count > 0) {                                                        \
                var const cl_heap_GV_I_bits##m * srcv =                         \
                  (const cl_heap_GV_I_bits##m *) outcast(srcvec);               \
                var cl_heap_GV_I_bits##m * destv =                              \
                  (cl_heap_GV_I_bits##m *) outcast(destvec);                    \
-               var uintL srclen = srcv->v.length();                            \
-               var uintL destlen = destv->v.length();                          \
+               var uintC srclen = srcv->v.length();                            \
+               var uintC destlen = destv->v.length();                          \
                if (!(srcindex <= srcindex+count && srcindex+count <= srclen))  \
                        cl_abort();                                             \
                if (!(destindex <= destindex+count && destindex+count <= destlen)) \
@@ -186,7 +186,7 @@ static void bits_do_delete (cl_GV_inner<cl_I>* vec)
 
 // Copy bits srcptr.bits[srcindex..srcindex+count-1] into destptr.bits[destindex..destindex+count-1].
 // Assumes that all range checks have already been performed.
-static void bits_copy (const uintD* srcptr, uintL srcindex, uintD* destptr, uintL destindex, uintL count)
+static void bits_copy (const uintD* srcptr, uintC srcindex, uintD* destptr, uintC destindex, uintC count)
 {
        srcptr += floor(srcindex,intDsize);
        destptr += floor(destindex,intDsize);
@@ -206,7 +206,7 @@ static void bits_copy (const uintD* srcptr, uintL srcindex, uintD* destptr, uint
                        count -= intDsize-srcindex;
                }
                // Now srcindex and destindex can be assumed to be 0.
-               var uintL count1 = count%intDsize;
+               var uintC count1 = count%intDsize;
                count = floor(count,intDsize);
                if (count > 0) {
                        do {
@@ -217,7 +217,7 @@ static void bits_copy (const uintD* srcptr, uintL srcindex, uintD* destptr, uint
                        *destptr ^= (*destptr ^ *srcptr) & (uintD)(bit(count1)-1);
                }
        } else {
-               var uintL i = destindex - srcindex;
+               var uintC i = destindex - srcindex;
                var uintD tmp;
                if (destindex >= srcindex) { // i > 0
                        if (count <= intDsize-destindex) {
@@ -239,7 +239,7 @@ static void bits_copy (const uintD* srcptr, uintL srcindex, uintD* destptr, uint
                }
                srcptr++;
                // tmp now contains the low i bits to be put into *destptr.
-               var uintL count1 = count%intDsize;
+               var uintC count1 = count%intDsize;
                count = floor(count,intDsize);
                var uintD lastdest;
                if (count == 0)
@@ -277,11 +277,11 @@ static void bits_copy (const uintD* srcptr, uintL srcindex, uintD* destptr, uint
 
 DEFINE_cl_heap_GV_I_bits(1,uintD)
 
-static const cl_I bits1_element (const cl_GV_inner<cl_I>* vec, uintL index)
+static const cl_I bits1_element (const cl_GV_inner<cl_I>* vec, uintC index)
 {
        return (unsigned int)((((const cl_heap_GV_I_bits1 *) outcast(vec))->data[index/intDsize] >> (index%intDsize)) & 0x1);
 }
-static void bits1_set_element (cl_GV_inner<cl_I>* vec, uintL index, const cl_I& x)
+static void bits1_set_element (cl_GV_inner<cl_I>* vec, uintC index, const cl_I& x)
 {
        var uintV xval;
        if (fixnump(x)) {
@@ -299,11 +299,11 @@ static void bits1_set_element (cl_GV_inner<cl_I>* vec, uintL index, const cl_I&
 
 DEFINE_cl_heap_GV_I_bits(2,uintD)
 
-static const cl_I bits2_element (const cl_GV_inner<cl_I>* vec, uintL index)
+static const cl_I bits2_element (const cl_GV_inner<cl_I>* vec, uintC index)
 {
        return (unsigned int)((((const cl_heap_GV_I_bits2 *) outcast(vec))->data[index/(intDsize/2)] >> (2*(index%(intDsize/2)))) & 0x3);
 }
-static void bits2_set_element (cl_GV_inner<cl_I>* vec, uintL index, const cl_I& x)
+static void bits2_set_element (cl_GV_inner<cl_I>* vec, uintC index, const cl_I& x)
 {
        var uintV xval;
        if (fixnump(x)) {
@@ -321,11 +321,11 @@ static void bits2_set_element (cl_GV_inner<cl_I>* vec, uintL index, const cl_I&
 
 DEFINE_cl_heap_GV_I_bits(4,uintD)
 
-static const cl_I bits4_element (const cl_GV_inner<cl_I>* vec, uintL index)
+static const cl_I bits4_element (const cl_GV_inner<cl_I>* vec, uintC index)
 {
        return (unsigned int)((((const cl_heap_GV_I_bits4 *) outcast(vec))->data[index/(intDsize/4)] >> (4*(index%(intDsize/4)))) & 0xF);
 }
-static void bits4_set_element (cl_GV_inner<cl_I>* vec, uintL index, const cl_I& x)
+static void bits4_set_element (cl_GV_inner<cl_I>* vec, uintC index, const cl_I& x)
 {
        var uintV xval;
        if (fixnump(x)) {
@@ -343,7 +343,7 @@ static void bits4_set_element (cl_GV_inner<cl_I>* vec, uintL index, const cl_I&
 
 DEFINE_cl_heap_GV_I_bits(8,uintD)
 
-static const cl_I bits8_element (const cl_GV_inner<cl_I>* vec, uintL index)
+static const cl_I bits8_element (const cl_GV_inner<cl_I>* vec, uintC index)
 {
        #if CL_CPU_BIG_ENDIAN_P
        return (unsigned int)((((const cl_heap_GV_I_bits8 *) outcast(vec))->data[index/(intDsize/8)] >> (8*(index%(intDsize/8)))) & 0xFF);
@@ -352,7 +352,7 @@ static const cl_I bits8_element (const cl_GV_inner<cl_I>* vec, uintL index)
        return (unsigned int)(((uint8*)(((const cl_heap_GV_I_bits8 *) outcast(vec))->data))[index]);
        #endif
 }
-static void bits8_set_element (cl_GV_inner<cl_I>* vec, uintL index, const cl_I& x)
+static void bits8_set_element (cl_GV_inner<cl_I>* vec, uintC index, const cl_I& x)
 {
        var uintV xval;
        if (fixnump(x)) {
@@ -375,7 +375,7 @@ static void bits8_set_element (cl_GV_inner<cl_I>* vec, uintL index, const cl_I&
 
 DEFINE_cl_heap_GV_I_bits(16,uintD)
 
-static const cl_I bits16_element (const cl_GV_inner<cl_I>* vec, uintL index)
+static const cl_I bits16_element (const cl_GV_inner<cl_I>* vec, uintC index)
 {
        #if CL_CPU_BIG_ENDIAN_P
        return (unsigned int)((((const cl_heap_GV_I_bits16 *) outcast(vec))->data[index/(intDsize/16)] >> (16*(index%(intDsize/16)))) & 0xFFFF);
@@ -384,7 +384,7 @@ static const cl_I bits16_element (const cl_GV_inner<cl_I>* vec, uintL index)
        return (unsigned int)(((uint16*)(((const cl_heap_GV_I_bits16 *) outcast(vec))->data))[index]);
        #endif
 }
-static void bits16_set_element (cl_GV_inner<cl_I>* vec, uintL index, const cl_I& x)
+static void bits16_set_element (cl_GV_inner<cl_I>* vec, uintC index, const cl_I& x)
 {
        var uintV xval;
        if (fixnump(x)) {
@@ -407,7 +407,7 @@ static void bits16_set_element (cl_GV_inner<cl_I>* vec, uintL index, const cl_I&
 
 DEFINE_cl_heap_GV_I_bits(32,uintD)
 
-static const cl_I bits32_element (const cl_GV_inner<cl_I>* vec, uintL index)
+static const cl_I bits32_element (const cl_GV_inner<cl_I>* vec, uintC index)
 {
        #if (intDsize==32)
        return (unsigned long)(((const cl_heap_GV_I_bits32 *) outcast(vec))->data[index]);
@@ -418,7 +418,7 @@ static const cl_I bits32_element (const cl_GV_inner<cl_I>* vec, uintL index)
        return (unsigned long)(((uint32*)(((const cl_heap_GV_I_bits32 *) outcast(vec))->data))[index]);
        #endif
 }
-static void bits32_set_element (cl_GV_inner<cl_I>* vec, uintL index, const cl_I& x)
+static void bits32_set_element (cl_GV_inner<cl_I>* vec, uintC index, const cl_I& x)
 {
        var uint32 xval = cl_I_to_UL(x);
        #if (intDsize==32)
@@ -443,7 +443,7 @@ static cl_GV_I_vectorops* bits_vectorops[6] = {
        &bits32_vectorops
 };
 
-cl_heap_GV_I* cl_make_heap_GV_I (uintL len, sintL m)
+cl_heap_GV_I* cl_make_heap_GV_I (uintC len, sintC m)
 {
        // Determine log2(bits).
        var uintL log2_bits;
@@ -468,27 +468,27 @@ cl_heap_GV_I* cl_make_heap_GV_I (uintL len, sintL m)
                        return cl_make_heap_GV_I(len);
        }
        // For room allocation purposes, be pessimistic: assume the uintD case (since intDsize>=32).
-       var uintL words = // ceiling(len*2^log2_bits,intDsize)
-         (((sintL)len-1)>>(log2_intDsize-log2_bits))+1;
+       var uintC words = // ceiling(len*2^log2_bits,intDsize)
+         (((sintC)len-1)>>(log2_intDsize-log2_bits))+1;
        var cl_heap_GV_I_bits32* hv = (cl_heap_GV_I_bits32*) malloc_hook(offsetofa(cl_heap_GV_I_bits32,data)+sizeof(uintD)*words);
        hv->refcount = 1;
        hv->type = &cl_class_gvector_integer;
        new (&hv->v) cl_GV_inner<cl_I> (len,&bits_vectorops[log2_bits]->ops);
        var uintD* ptr = (uintD*)(hv->data);
-       for (var uintL i = 0; i < words; i++)
+       for (var uintC i = 0; i < words; i++)
                ptr[i] = 0;
        return (cl_heap_GV_I*) hv;
 }
 
 
-sintL cl_heap_GV_I::maxbits () const
+sintC cl_heap_GV_I::maxbits () const
 {
        return outcast(v.vectorops)->m;
 }
 
 
 // An empty vector.
-const cl_GV_I cl_null_GV_I = cl_GV_I((uintL)0);
+const cl_GV_I cl_null_GV_I = cl_GV_I((uintC)0);
 
 }  // namespace cln
 
index 2cbc88f3ab260d2bb01d91e26f7e76c011ac69f7..8a0533b83e9c44fe21239d95ef56508ffd22d74e 100644 (file)
@@ -14,7 +14,7 @@ namespace cln {
 
 const cl_GV_I copy (const cl_GV_I& v)
 {
-       var uintL len = v.length();
+       var uintC len = v.length();
        var cl_GV_I w = cl_GV_I(len,v.maxbits());
        cl_GV_I::copy_elements(v,0,w,0,len);
        return w;
index 4b019ee99e241818ef08a5da918062bbcbe5c533..20af58ad9e93ad4368c0cc0d17eff8687d2b2e3d 100644 (file)
@@ -53,12 +53,12 @@ struct cl_heap_GV_number_general : public cl_heap_GV_number {
        cl_heap_GV_number_general ();
 };
 
-static const cl_number general_element (const cl_GV_inner<cl_number>* vec, uintL index)
+static const cl_number general_element (const cl_GV_inner<cl_number>* vec, uintC index)
 {
        return ((const cl_heap_GV_number_general *) outcast(vec))->data[index];
 }
 
-static void general_set_element (cl_GV_inner<cl_number>* vec, uintL index, const cl_number& x)
+static void general_set_element (cl_GV_inner<cl_number>* vec, uintC index, const cl_number& x)
 {
        ((cl_heap_GV_number_general *) outcast(vec))->data[index] = x;
 }
@@ -66,20 +66,20 @@ static void general_set_element (cl_GV_inner<cl_number>* vec, uintL index, const
 static void general_do_delete (cl_GV_inner<cl_number>* vec)
 {
        var cl_heap_GV_number_general* hv = (cl_heap_GV_number_general *) outcast(vec);
-       var uintL len = hv->v.length();
-       for (var uintL i = 0; i < len; i++)
+       var uintC len = hv->v.length();
+       for (var uintC i = 0; i < len; i++)
                hv->data[i].~cl_number();
 }
 
-static void general_copy_elements (const cl_GV_inner<cl_number>* srcvec, uintL srcindex, cl_GV_inner<cl_number>* destvec, uintL destindex, uintL count)
+static void general_copy_elements (const cl_GV_inner<cl_number>* srcvec, uintC srcindex, cl_GV_inner<cl_number>* destvec, uintC destindex, uintC count)
 {
        if (count > 0) {
                var const cl_heap_GV_number_general* srcv =
                  (const cl_heap_GV_number_general *) outcast(srcvec);
                var cl_heap_GV_number_general* destv =
                  (cl_heap_GV_number_general *) outcast(destvec);
-               var uintL srclen = srcv->v.length();
-               var uintL destlen = destv->v.length();
+               var uintC srclen = srcv->v.length();
+               var uintC destlen = destv->v.length();
                if (!(srcindex <= srcindex+count && srcindex+count <= srclen))
                        cl_abort();
                if (!(destindex <= destindex+count && destindex+count <= destlen))
@@ -97,19 +97,19 @@ static cl_GV_vectorops<cl_number> general_vectorops = {
        general_copy_elements
 };
 
-cl_heap_GV_number* cl_make_heap_GV_number (uintL len)
+cl_heap_GV_number* cl_make_heap_GV_number (uintC len)
 {
        var cl_heap_GV_number_general* hv = (cl_heap_GV_number_general*) malloc_hook(offsetofa(cl_heap_GV_number_general,data)+sizeof(cl_number)*len);
        hv->refcount = 1;
        hv->type = &cl_class_gvector_number;
        new (&hv->v) cl_GV_inner<cl_number> (len,&general_vectorops);
-       for (var uintL i = 0; i < len; i++)
+       for (var uintC i = 0; i < len; i++)
                init1(cl_number, hv->data[i]) ();
        return hv;
 }
 
 // An empty vector.
-const cl_GV_number cl_null_GV_number = cl_GV_number((uintL)0);
+const cl_GV_number cl_null_GV_number = cl_GV_number((uintC)0);
 
 }  // namespace cln
 
index 9622f19c2e9f2fecc78f1aaadf3356828f5a14b3..3164f2a59df620f74fdb9065c8034338027f544d 100644 (file)
@@ -14,7 +14,7 @@ namespace cln {
 
 const cl_GV_number copy (const cl_GV_number& v)
 {
-       var uintL len = v.length();
+       var uintC len = v.length();
        var cl_GV_number w = cl_GV_number(len);
        cl_GV_number::copy_elements(v,0,w,0,len);
        return w;
index 9277c290c165f19b470a9c0d90ed25edcb401d7a..45690fa0c9d332f2298486a662d3c3e8b14e2a9c 100644 (file)
@@ -16,12 +16,12 @@ namespace cln {
 
 const cl_SV_any copy (const cl_SV_any& src)
 {
-       var uintL len = src.length();
+       var uintC len = src.length();
        var cl_heap_SV_any* hv = (cl_heap_SV_any*) malloc_hook(sizeof(cl_heap_SV_any)+sizeof(cl_gcobject)*len);
        hv->refcount = 1;
        hv->type = src.pointer_type();
        new (&hv->v) cl_SV_inner<cl_gcobject> (len);
-       for (var uintL i = 0; i < len; i++)
+       for (var uintC i = 0; i < len; i++)
                init1(cl_gcobject, hv->v[i]) (src[i]);
        return hv;
 }
index d694ab450bbcedc4096298a3e5dce67c0f9db233..80b5a5dd0be38eaa86ecae3b216b1aecf6e2b5c7 100644 (file)
@@ -29,7 +29,7 @@ cl_class cl_class_svector_number = {
        0
 };
 
-cl_heap_SV_number* cl_make_heap_SV_number_uninit (uintL len)
+cl_heap_SV_number* cl_make_heap_SV_number_uninit (uintC len)
 {
        var cl_heap_SV_number* hv = (cl_heap_SV_number*) malloc_hook(sizeof(cl_heap_SV_number)+sizeof(cl_number)*len);
        hv->refcount = 1;
@@ -39,19 +39,19 @@ cl_heap_SV_number* cl_make_heap_SV_number_uninit (uintL len)
        return hv;
 }
 
-cl_heap_SV_number* cl_make_heap_SV_number (uintL len)
+cl_heap_SV_number* cl_make_heap_SV_number (uintC len)
 {
        var cl_heap_SV_number* hv = (cl_heap_SV_number*) malloc_hook(sizeof(cl_heap_SV_number)+sizeof(cl_number)*len);
        hv->refcount = 1;
        hv->type = &cl_class_svector_number;
        new (&hv->v) cl_SV_inner<cl_number> (len);
-       for (var uintL i = 0; i < len; i++)
+       for (var uintC i = 0; i < len; i++)
                init1(cl_number, hv->v[i]) (0);
        return hv;
 }
 
 // An empty vector.
-const cl_SV_number cl_null_SV_number = cl_SV_number((uintL)0);
+const cl_SV_number cl_null_SV_number = cl_SV_number((uintC)0);
 
 }  // namespace cln
 
index 4071daaf6a143c9a12a340893821bfd306e1ebba..48587aec01528a91b7393c57904ab3af765eef23 100644 (file)
@@ -29,7 +29,7 @@ cl_class cl_class_svector_ringelt = {
        0
 };
 
-cl_heap_SV_ringelt* cl_make_heap_SV_ringelt_uninit (uintL len)
+cl_heap_SV_ringelt* cl_make_heap_SV_ringelt_uninit (uintC len)
 {
        var cl_heap_SV_ringelt* hv = (cl_heap_SV_ringelt*) malloc_hook(sizeof(cl_heap_SV_ringelt)+sizeof(_cl_ring_element)*len);
        hv->refcount = 1;
@@ -39,19 +39,19 @@ cl_heap_SV_ringelt* cl_make_heap_SV_ringelt_uninit (uintL len)
        return hv;
 }
 
-cl_heap_SV_ringelt* cl_make_heap_SV_ringelt (uintL len)
+cl_heap_SV_ringelt* cl_make_heap_SV_ringelt (uintC len)
 {
        var cl_heap_SV_ringelt* hv = (cl_heap_SV_ringelt*) malloc_hook(sizeof(cl_heap_SV_ringelt)+sizeof(_cl_ring_element)*len);
        hv->refcount = 1;
        hv->type = &cl_class_svector_ringelt;
        new (&hv->v) cl_SV_inner<_cl_ring_element> (len);
-       for (var uintL i = 0; i < len; i++)
+       for (var uintC i = 0; i < len; i++)
                init1(_cl_ring_element, hv->v[i]) ();
        return hv;
 }
 
 // An empty vector.
-const cl_SV_ringelt cl_null_SV_ringelt = cl_SV_ringelt((uintL)0);
+const cl_SV_ringelt cl_null_SV_ringelt = cl_SV_ringelt((uintC)0);
 
 }  // namespace cln
 
index e928abfb9722885003530f045a315dc0f35dad39..136eb56a9f0c908cb444b70726721afac8179894 100644 (file)
@@ -82,7 +82,7 @@ int main (int argc, char* argv[])
 #if 0
        float_format_t f = float_format(atoi(argv[1]));
        extern cl_LF zeta3 (uintC len);
-       uintC len = (uintL)f/intDsize+1;
+       uintC len = (uintC)f/intDsize+1;
        { CL_TIMING; cout << zeta(2,f) << endl; }
        { CL_TIMING; cout << expt(pi(f),2)/6 << endl; }
        { CL_TIMING; cout << zeta(3,f) << endl; }
index 9a45a4de037a39de03a32bc2ceb3142943402d3d..600b4b56c8e0b1a3d18dc808475de8cb0433a781 100644 (file)
@@ -7,7 +7,7 @@ int test_I_integer_length (int iterations)
        // Check against ash.
        for (i = iterations; i > 0; i--) {
                cl_I a = testrandom_I();
-               uintL l = integer_length(a);
+               uintC l = integer_length(a);
                if (a >= 0) {
                        int b = 0;
                        if (a < ash(1,l)) {
index b4c1bd4c39035e8d624ae994dbd20df39faa0648..36fd58c49d7f38b7219ede631070d1f22689ef9a 100644 (file)
@@ -8,10 +8,10 @@ int test_I_ord2 (int iterations)
        for (i = iterations; i > 0; i--) {
                cl_I a = testrandom_I();
                if (a != 0) {
-                       uintL n = ord2(a);
-                       cl_I b = ash(a,-(sintL)n);
+                       uintC n = ord2(a);
+                       cl_I b = ash(a,-(sintC)n);
                        ASSERT1(oddp(b), a);
-                       ASSERT1(a == ash(b,(sintL)n), a);
+                       ASSERT1(a == ash(b,(sintC)n), a);
                }
        }
        return error;