You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

329 lines
10 KiB

25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
Extend the exponent range from 32 bits to 64 bits on selected platforms. * include/cln/number.h: Add signatures for operations with long long. * include/cln/complex_class.h: Likewise. * include/cln/real_class.h: Likewise. * include/cln/real.h: Likewise. * include/cln/rational_class.h: Likewise. * include/cln/rational.h: Likewise. * include/cln/integer_class.h: Likewise. * include/cln/integer.h: Likewise. * include/cln/float.h: Likewise. * include/cln/lfloat.h: Likewise. * include/cln/types.h (sintE and uintE): New types for exponents. * include/cln/*float.h: Use the new types for exponents. * include/cln/floatformat.h (float_format_t): Make underlying type compatible with sintE. * doc/cln.tex: Document changed float_exponent return value. * src/float/cl_F.h: Likewise. * src/float/ffloat/misc/cl_FF_exponent.cc: Likewise. * src/float/input/cl_F_read.cc: Likewise. * src/float/lfloat/cl_LF.h: Likewise. * src/float/lfloat/cl_LF_impl.h: 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_compare.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_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_mul.cc: Likewise. * src/float/lfloat/elem/cl_LF_scale.cc: Likewise. * src/float/lfloat/elem/cl_LF_scale_I.cc: Likewise. * src/float/lfloat/elem/cl_LF_square.cc: Likewise. * src/float/lfloat/elem/cl_LF_to_I.cc: Likewise. * src/float/lfloat/misc/cl_LF_decode.cc: Likewise. * src/float/lfloat/misc/cl_LF_exponent.cc: Likewise. * src/float/lfloat/misc/cl_LF_idecode.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_decode.cc: Likewise. * src/float/misc/cl_F_exponent.cc: Likewise. * src/float/misc/cl_F_shortenrel.cc: Likewise. * src/float/misc/cl_float_format.cc: Likewise. * src/float/output/cl_F_dprint.cc: Likewise. * src/float/sfloat/misc/cl_SF_exponent.cc: Likewise. * src/float/transcendental/cl_F_atanhx.cc: Likewise. * src/float/transcendental/cl_F_atanx.cc: Likewise. * src/float/transcendental/cl_F_cosh.cc: Likewise. * src/float/transcendental/cl_F_expx.cc: Likewise. * src/float/transcendental/cl_F_lnx.cc: Likewise. * src/float/transcendental/cl_F_sinhx.cc: Likewise. * src/float/transcendental/cl_F_sinx.cc: Likewise. * src/float/transcendental/cl_LF_pi.cc: Likewise. * src/integer/cl_I.h: Likewise. * src/complex/algebraic/cl_LF_hypot.cc: Likewise. * src/complex/elem/division/cl_C_LF_recip.cc: Likewise. * src/float/dfloat/misc/cl_DF_exponent.cc: Likewise. * src/integer/conv/cl_I_from_Q2.cc: Added. * src/base/cl_low.h (isqrtC): New function, for 64 bit falls back to... * src/base/low/cl_low_isqrt.cc (isqrt): ...this new implementation. * src/base/cl_macros.h (bitc): Make sure 64 bit is used if required by exponent operations. * examples/pi.cc: Support more than 646456614 decimal digits.
18 years ago
25 years ago
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.
19 years ago
25 years ago
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.
19 years ago
25 years ago
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.
19 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
  1. // Public single float operations.
  2. #ifndef _CL_FFLOAT_H
  3. #define _CL_FFLOAT_H
  4. #include "cln/number.h"
  5. #include "cln/ffloat_class.h"
  6. #include "cln/integer_class.h"
  7. #include "cln/float.h"
  8. namespace cln {
  9. CL_DEFINE_AS_CONVERSION(cl_FF)
  10. // Liefert zu einem Single-Float x : (- x), ein FF.
  11. extern const cl_FF operator- (const cl_FF& x);
  12. // compare(x,y) vergleicht zwei Single-Floats x und y.
  13. // Ergebnis: 0 falls x=y, +1 falls x>y, -1 falls x<y.
  14. extern cl_signean compare (const cl_FF& x, const cl_FF& y);
  15. // equal_hashcode(x) liefert einen equal-invarianten Hashcode für x.
  16. extern uint32 equal_hashcode (const cl_FF& x);
  17. inline bool operator== (const cl_FF& x, const cl_FF& y)
  18. { return compare(x,y)==0; }
  19. inline bool operator!= (const cl_FF& x, const cl_FF& y)
  20. { return compare(x,y)!=0; }
  21. inline bool operator<= (const cl_FF& x, const cl_FF& y)
  22. { return compare(x,y)<=0; }
  23. inline bool operator< (const cl_FF& x, const cl_FF& y)
  24. { return compare(x,y)<0; }
  25. inline bool operator>= (const cl_FF& x, const cl_FF& y)
  26. { return compare(x,y)>=0; }
  27. inline bool operator> (const cl_FF& x, const cl_FF& y)
  28. { return compare(x,y)>0; }
  29. // minusp(x) == (< x 0)
  30. extern bool minusp (const cl_FF& x);
  31. // zerop(x) stellt fest, ob ein Single-Float x = 0.0 ist.
  32. extern bool zerop (const cl_FF& x);
  33. // plusp(x) == (> x 0)
  34. extern bool plusp (const cl_FF& x);
  35. // Liefert zu zwei Single-Float x und y : (+ x y), ein FF.
  36. extern const cl_FF operator+ (const cl_FF& x, const cl_FF& y);
  37. // The C++ compiler may hesitate to do these conversions of its own:
  38. inline const cl_FF operator+ (const cl_FF& x, const float y)
  39. { return x + cl_FF(y); }
  40. inline const cl_FF operator+ (const float x, const cl_FF& y)
  41. { return cl_FF(x) + y; }
  42. // Liefert zu zwei Single-Float x und y : (- x y), ein FF.
  43. extern const cl_FF operator- (const cl_FF& x, const cl_FF& y);
  44. // The C++ compiler may hesitate to do these conversions of its own:
  45. inline const cl_FF operator- (const cl_FF& x, const float y)
  46. { return x - cl_FF(y); }
  47. inline const cl_FF operator- (const float x, const cl_FF& y)
  48. { return cl_FF(x) - y; }
  49. // Liefert zu zwei Single-Float x und y : (* x y), ein FF.
  50. extern const cl_FF operator* (const cl_FF& x, const cl_FF& y);
  51. // The C++ compiler may hesitate to do these conversions of its own:
  52. inline const cl_FF operator* (const cl_FF& x, const float y)
  53. { return x * cl_FF(y); }
  54. inline const cl_FF operator* (const float x, const cl_FF& y)
  55. { return cl_FF(x) * y; }
  56. // Liefert zu einem Single-Float x : (* x x), ein FF.
  57. inline const cl_FF square (const cl_FF& x) { return x*x; }
  58. // Liefert zu zwei Single-Float x und y : (/ x y), ein FF.
  59. extern const cl_FF operator/ (const cl_FF& x, const cl_FF& y);
  60. // The C++ compiler may hesitate to do these conversions of its own:
  61. inline const cl_FF operator/ (const cl_FF& x, const float y)
  62. { return x / cl_FF(y); }
  63. inline const cl_FF operator/ (const float x, const cl_FF& y)
  64. { return cl_FF(x) / y; }
  65. // Liefert zu einem Single-Float x>=0 : (sqrt x), ein FF.
  66. extern const cl_FF sqrt (const cl_FF& x);
  67. // recip(x) liefert (/ x), wo x ein Single-Float ist.
  68. extern const cl_FF recip (const cl_FF& x);
  69. // abs(x) liefert (abs x), wo x ein Single-Float ist.
  70. extern const cl_FF abs (const cl_FF& x);
  71. // (1+ x), wo x ein Single-Float ist.
  72. inline const cl_FF plus1 (const cl_FF& x)
  73. {
  74. extern const cl_FF cl_I_to_FF (const cl_I&);
  75. return x + cl_I_to_FF(cl_I(1));
  76. }
  77. // (1- x), wo x ein Single-Float ist.
  78. inline const cl_FF minus1 (const cl_FF& x)
  79. {
  80. extern const cl_FF cl_I_to_FF (const cl_I&);
  81. return x + cl_I_to_FF(cl_I(-1));
  82. }
  83. // ffloor(x) liefert (ffloor x), wo x ein FF ist.
  84. extern const cl_FF ffloor (const cl_FF& x);
  85. // fceiling(x) liefert (fceiling x), wo x ein FF ist.
  86. extern const cl_FF fceiling (const cl_FF& x);
  87. // ftruncate(x) liefert (ftruncate x), wo x ein FF ist.
  88. extern const cl_FF ftruncate (const cl_FF& x);
  89. // fround(x) liefert (fround x), wo x ein FF ist.
  90. extern const cl_FF fround (const cl_FF& x);
  91. // Return type for frounding operators.
  92. // x / y --> (q,r) with x = y*q+r.
  93. struct cl_FF_fdiv_t {
  94. cl_FF quotient;
  95. cl_FF remainder;
  96. // Constructor.
  97. cl_FF_fdiv_t () {}
  98. cl_FF_fdiv_t (const cl_FF& q, const cl_FF& r) : quotient(q), remainder(r) {}
  99. };
  100. // ffloor2(x) liefert (ffloor x), wo x ein FF ist.
  101. inline const cl_FF_fdiv_t ffloor2 (const cl_FF& x)
  102. { cl_FF q = ffloor(x); return cl_FF_fdiv_t(q,x-q); }
  103. // fceiling2(x) liefert (fceiling x), wo x ein FF ist.
  104. inline const cl_FF_fdiv_t fceiling2 (const cl_FF& x)
  105. { cl_FF q = fceiling(x); return cl_FF_fdiv_t(q,x-q); }
  106. // ftruncate2(x) liefert (ftruncate x), wo x ein FF ist.
  107. inline const cl_FF_fdiv_t ftruncate2 (const cl_FF& x)
  108. { cl_FF q = ftruncate(x); return cl_FF_fdiv_t(q,x-q); }
  109. // fround2(x) liefert (fround x), wo x ein FF ist.
  110. inline const cl_FF_fdiv_t fround2 (const cl_FF& x)
  111. { cl_FF q = fround(x); return cl_FF_fdiv_t(q,x-q); }
  112. // Return type for rounding operators.
  113. // x / y --> (q,r) with x = y*q+r.
  114. struct cl_FF_div_t {
  115. cl_I quotient;
  116. cl_FF remainder;
  117. // Constructor.
  118. cl_FF_div_t () {}
  119. cl_FF_div_t (const cl_I& q, const cl_FF& r) : quotient(q), remainder(r) {}
  120. };
  121. // floor2(x) liefert (floor x), wo x ein FF ist.
  122. inline const cl_FF_div_t floor2 (const cl_FF& x)
  123. {
  124. extern const cl_I cl_FF_to_I (const cl_FF& x);
  125. cl_FF q = ffloor(x);
  126. return cl_FF_div_t(cl_FF_to_I(q),x-q);
  127. }
  128. inline const cl_I floor1 (const cl_FF& x)
  129. {
  130. extern const cl_I cl_FF_to_I (const cl_FF& x);
  131. return cl_FF_to_I(ffloor(x));
  132. }
  133. // ceiling2(x) liefert (ceiling x), wo x ein FF ist.
  134. inline const cl_FF_div_t ceiling2 (const cl_FF& x)
  135. {
  136. extern const cl_I cl_FF_to_I (const cl_FF& x);
  137. cl_FF q = fceiling(x);
  138. return cl_FF_div_t(cl_FF_to_I(q),x-q);
  139. }
  140. inline const cl_I ceiling1 (const cl_FF& x)
  141. {
  142. extern const cl_I cl_FF_to_I (const cl_FF& x);
  143. return cl_FF_to_I(fceiling(x));
  144. }
  145. // truncate2(x) liefert (truncate x), wo x ein FF ist.
  146. inline const cl_FF_div_t truncate2 (const cl_FF& x)
  147. {
  148. extern const cl_I cl_FF_to_I (const cl_FF& x);
  149. cl_FF q = ftruncate(x);
  150. return cl_FF_div_t(cl_FF_to_I(q),x-q);
  151. }
  152. inline const cl_I truncate1 (const cl_FF& x)
  153. {
  154. extern const cl_I cl_FF_to_I (const cl_FF& x);
  155. return cl_FF_to_I(ftruncate(x));
  156. }
  157. // round2(x) liefert (round x), wo x ein FF ist.
  158. inline const cl_FF_div_t round2 (const cl_FF& x)
  159. {
  160. extern const cl_I cl_FF_to_I (const cl_FF& x);
  161. cl_FF q = fround(x);
  162. return cl_FF_div_t(cl_FF_to_I(q),x-q);
  163. }
  164. inline const cl_I round1 (const cl_FF& x)
  165. {
  166. extern const cl_I cl_FF_to_I (const cl_FF& x);
  167. return cl_FF_to_I(fround(x));
  168. }
  169. // floor2(x,y) liefert (floor x y).
  170. extern const cl_FF_div_t floor2 (const cl_FF& x, const cl_FF& y);
  171. inline const cl_I floor1 (const cl_FF& x, const cl_FF& y) { return floor1(x/y); }
  172. // ceiling2(x,y) liefert (ceiling x y).
  173. extern const cl_FF_div_t ceiling2 (const cl_FF& x, const cl_FF& y);
  174. inline const cl_I ceiling1 (const cl_FF& x, const cl_FF& y) { return ceiling1(x/y); }
  175. // truncate2(x,y) liefert (truncate x y).
  176. extern const cl_FF_div_t truncate2 (const cl_FF& x, const cl_FF& y);
  177. inline const cl_I truncate1 (const cl_FF& x, const cl_FF& y) { return truncate1(x/y); }
  178. // round2(x,y) liefert (round x y).
  179. extern const cl_FF_div_t round2 (const cl_FF& x, const cl_FF& y);
  180. inline const cl_I round1 (const cl_FF& x, const cl_FF& y) { return round1(x/y); }
  181. // Return type for decode_float:
  182. struct decoded_ffloat {
  183. cl_FF mantissa;
  184. cl_I exponent;
  185. cl_FF sign;
  186. // Constructor.
  187. decoded_ffloat () {}
  188. decoded_ffloat (const cl_FF& m, const cl_I& e, const cl_FF& s) : mantissa(m), exponent(e), sign(s) {}
  189. };
  190. // decode_float(x) liefert zu einem Float x: (decode-float x).
  191. // x = 0.0 liefert (0.0, 0, 1.0).
  192. // x = (-1)^s * 2^e * m liefert ((-1)^0 * 2^0 * m, e als Integer, (-1)^s).
  193. extern const decoded_ffloat decode_float (const cl_FF& x);
  194. // float_exponent(x) liefert zu einem Float x:
  195. // den Exponenten von (decode-float x).
  196. // x = 0.0 liefert 0.
  197. // x = (-1)^s * 2^e * m liefert e.
  198. extern sintE float_exponent (const cl_FF& x);
  199. // float_radix(x) liefert (float-radix x), wo x ein Float ist.
  200. inline sintL float_radix (const cl_FF& x)
  201. {
  202. (void)x; // unused x
  203. return 2;
  204. }
  205. // float_sign(x) liefert (float-sign x), wo x ein Float ist.
  206. extern const cl_FF float_sign (const cl_FF& x);
  207. // float_digits(x) liefert (float-digits x), wo x ein Float ist.
  208. // < ergebnis: ein uintC >0
  209. extern uintC float_digits (const cl_FF& x);
  210. // float_precision(x) liefert (float-precision x), wo x ein Float ist.
  211. // < ergebnis: ein uintC >=0
  212. extern uintC float_precision (const cl_FF& x);
  213. // integer_decode_float(x) liefert zu einem Float x: (integer-decode-float x).
  214. // x = 0.0 liefert (0, 0, 1).
  215. // x = (-1)^s * 2^e * m bei Float-Precision p liefert
  216. // (Mantisse 2^p * m als Integer, e-p als Integer, (-1)^s als Fixnum).
  217. extern const cl_idecoded_float integer_decode_float (const cl_FF& x);
  218. // scale_float(x,delta) liefert x*2^delta, wo x ein FF ist.
  219. extern const cl_FF scale_float (const cl_FF& x, sintC delta);
  220. extern const cl_FF scale_float (const cl_FF& x, const cl_I& delta);
  221. // max(x,y) liefert (max x y), wo x und y Floats sind.
  222. extern const cl_FF max (const cl_FF& x, const cl_FF& y);
  223. // min(x,y) liefert (min x y), wo x und y Floats sind.
  224. extern const cl_FF min (const cl_FF& x, const cl_FF& y);
  225. // signum(x) liefert (signum x), wo x ein Float ist.
  226. extern const cl_FF signum (const cl_FF& x);
  227. // Konversion zu einem C "float".
  228. extern float float_approx (const cl_FF& x);
  229. // Konversion zu einem C "double".
  230. extern double double_approx (const cl_FF& x);
  231. // This could be optimized to use in-place operations.
  232. inline cl_FF& operator+= (cl_FF& x, const cl_FF& y) { return x = x + y; }
  233. inline cl_FF& operator+= (cl_FF& x, const float y) { return x = x + y; }
  234. inline cl_FF& operator++ /* prefix */ (cl_FF& x) { return x = plus1(x); }
  235. inline void operator++ /* postfix */ (cl_FF& x, int dummy) { (void)dummy; x = plus1(x); }
  236. inline cl_FF& operator-= (cl_FF& x, const cl_FF& y) { return x = x - y; }
  237. inline cl_FF& operator-= (cl_FF& x, const float y) { return x = x - y; }
  238. inline cl_FF& operator-- /* prefix */ (cl_FF& x) { return x = minus1(x); }
  239. inline void operator-- /* postfix */ (cl_FF& x, int dummy) { (void)dummy; x = minus1(x); }
  240. inline cl_FF& operator*= (cl_FF& x, const cl_FF& y) { return x = x * y; }
  241. inline cl_FF& operator*= (cl_FF& x, const float y) { return x = x * y; }
  242. inline cl_FF& operator/= (cl_FF& x, const cl_FF& y) { return x = x / y; }
  243. inline cl_FF& operator/= (cl_FF& x, const float y) { return x = x / y; }
  244. /* */
  245. // Runtime typing support.
  246. extern cl_class cl_class_ffloat;
  247. #ifdef CL_WIDE_POINTERS
  248. CL_FORCE_LINK(cl_FF_classes_dummy, cl_class_ffloat)
  249. #endif
  250. // Debugging support.
  251. #ifdef CL_DEBUG
  252. extern int cl_FF_debug_module;
  253. CL_FORCE_LINK(cl_FF_debug_dummy, cl_FF_debug_module)
  254. #endif
  255. } // namespace cln
  256. #endif /* _CL_FFLOAT_H */