]> www.ginac.de Git - cln.git/commitdiff
* */*: Remove cl_boolean, cl_true, and cl_false in favor of built-in
authorRichard Kreckel <kreckel@ginac.de>
Wed, 1 Aug 2007 22:07:36 +0000 (22:07 +0000)
committerRichard Kreckel <kreckel@ginac.de>
Wed, 1 Aug 2007 22:07:36 +0000 (22:07 +0000)
        C++ bool, true, and false.

189 files changed:
ChangeLog
NEWS
doc/cln.tex
include/cln/complex.h
include/cln/dfloat.h
include/cln/dfloat_class.h
include/cln/ffloat.h
include/cln/ffloat_class.h
include/cln/float.h
include/cln/input.h
include/cln/integer.h
include/cln/lfloat.h
include/cln/lfloat_class.h
include/cln/modinteger.h
include/cln/numtheory.h
include/cln/object.h
include/cln/output.h
include/cln/rational.h
include/cln/real.h
include/cln/ring.h
include/cln/sfloat.h
include/cln/sfloat_class.h
include/cln/types.h
include/cln/univpoly.h
include/cln/univpoly_complex.h
include/cln/univpoly_integer.h
include/cln/univpoly_modint.h
include/cln/univpoly_rational.h
include/cln/univpoly_real.h
src/base/digitseq/cl_2DS_div.cc
src/base/digitseq/cl_DS.h
src/base/digitseq/cl_DS_div.cc
src/base/digitseq/cl_DS_mul.cc
src/base/digitseq/cl_DS_mul_kara.h
src/base/digitseq/cl_DS_sqrt.cc
src/base/hash/cl_hash.h
src/base/hash/cl_hash1weak.h
src/base/hash/cl_hash2weak.h
src/base/hash/cl_hashuniqweak.h
src/base/hash/cl_rcpointer2_hashweak_rcpointer.cc
src/base/hash/cl_rcpointer2_hashweak_rcpointer.h
src/base/hash/cl_rcpointer_hashweak_rcpointer.cc
src/base/hash/cl_rcpointer_hashweak_rcpointer.h
src/base/output/cl_prin_globals.cc
src/base/ring/cl_no_ring.cc
src/complex/cl_C.h
src/complex/elem/cl_C_equal.cc
src/complex/elem/cl_C_zerop.cc
src/complex/input/cl_N_from_string.cc
src/complex/input/cl_N_read.cc
src/complex/input/cl_N_read_stream.cc
src/complex/misc/cl_C_expt_I.cc
src/complex/misc/cl_N_as.cc
src/complex/ring/cl_C_ring.cc
src/complex/transcendental/cl_C_expt_C.cc
src/float/base/cl_F_globals.cc
src/float/cl_F.h
src/float/dfloat/algebraic/cl_DF_sqrt.cc
src/float/dfloat/conv/cl_I_to_double.cc
src/float/dfloat/elem/cl_DF_from_I.cc
src/float/dfloat/elem/cl_DF_minusp.cc
src/float/dfloat/elem/cl_DF_plusp.cc
src/float/dfloat/elem/cl_DF_zerop.cc
src/float/dfloat/input/cl_DF_from_string.cc
src/float/dfloat/misc/cl_DF_as.cc
src/float/elem/cl_F_minusp.cc
src/float/elem/cl_F_plusp.cc
src/float/elem/cl_F_zerop.cc
src/float/ffloat/conv/cl_I_to_float.cc
src/float/ffloat/elem/cl_FF_from_I.cc
src/float/ffloat/elem/cl_FF_minusp.cc
src/float/ffloat/elem/cl_FF_plusp.cc
src/float/ffloat/elem/cl_FF_zerop.cc
src/float/ffloat/input/cl_FF_from_string.cc
src/float/ffloat/misc/cl_FF_as.cc
src/float/input/cl_F_from_string.cc
src/float/input/cl_F_read.cc
src/float/input/cl_F_read_stream.cc
src/float/lfloat/algebraic/cl_LF_sqrt.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_from_I.cc
src/float/lfloat/elem/cl_LF_minusp.cc
src/float/lfloat/elem/cl_LF_plusp.cc
src/float/lfloat/elem/cl_LF_zerop.cc
src/float/lfloat/input/cl_LF_from_string.cc
src/float/lfloat/misc/cl_LF_as.cc
src/float/misc/cl_F_as.cc
src/float/output/cl_F_dprint.cc
src/float/sfloat/elem/cl_SF_from_I.cc
src/float/sfloat/elem/cl_SF_minusp.cc
src/float/sfloat/elem/cl_SF_plusp.cc
src/float/sfloat/elem/cl_SF_zerop.cc
src/float/sfloat/input/cl_SF_from_string.cc
src/float/sfloat/misc/cl_SF_as.cc
src/float/transcendental/cl_F_atanx.cc
src/float/transcendental/cl_F_expx.cc
src/float/transcendental/cl_F_lnx.cc
src/float/transcendental/cl_LF_coshsinh.cc
src/float/transcendental/cl_LF_cossin.cc
src/float/transcendental/cl_LF_ratsumseries_pqcd_aux.cc
src/float/transcendental/cl_LF_ratsumseries_pqd_aux.cc
src/float/transcendental/cl_LF_tran.h
src/integer/algebraic/cl_I_rootp.cc
src/integer/algebraic/cl_I_rootp_I.cc
src/integer/algebraic/cl_I_rootp_aux.cc
src/integer/algebraic/cl_I_sqrt.cc
src/integer/algebraic/cl_I_sqrtp.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_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_logtest.cc
src/integer/bitwise/cl_I_mkfx.cc
src/integer/cl_I.h
src/integer/conv/cl_I_to_digits.cc
src/integer/elem/cl_I_div.cc
src/integer/elem/cl_I_equal.cc
src/integer/elem/cl_I_minusp.cc
src/integer/elem/cl_I_mul.cc
src/integer/elem/cl_I_plusp.cc
src/integer/elem/cl_I_square.cc
src/integer/elem/cl_I_zerop.cc
src/integer/gcd/cl_I_gcd.cc
src/integer/gcd/cl_I_xgcd.cc
src/integer/hash/cl_I_hashweak_rcpointer.cc
src/integer/hash/cl_I_hashweak_rcpointer.h
src/integer/input/cl_I_from_string.cc
src/integer/input/cl_I_read_stream.cc
src/integer/misc/cl_I_as.cc
src/integer/misc/cl_I_oddp.cc
src/integer/output/cl_I_print_string.cc
src/integer/random/cl_I_random.cc
src/integer/random/cl_I_trandom.cc
src/integer/ring/cl_0_ring.cc
src/integer/ring/cl_I_ring.cc
src/modinteger/cl_MI.cc
src/modinteger/cl_MI_int.h
src/modinteger/cl_MI_montgom.h
src/modinteger/cl_MI_pow2m1.h
src/modinteger/cl_MI_std.h
src/numtheory/cl_IF.h
src/numtheory/cl_IF_millerrabin.cc
src/numtheory/cl_IF_trialdiv.cc
src/numtheory/cl_nt_isprobprime.cc
src/polynomial/elem/cl_UP_GF2.h
src/polynomial/elem/cl_UP_MI.h
src/polynomial/elem/cl_UP_gen.h
src/polynomial/elem/cl_UP_named.cc
src/polynomial/elem/cl_UP_no_ring.cc
src/polynomial/elem/cl_UP_number.h
src/polynomial/elem/cl_UP_unnamed.cc
src/rational/algebraic/cl_RA_rootp.cc
src/rational/algebraic/cl_RA_rootp_I.cc
src/rational/algebraic/cl_RA_sqrtp.cc
src/rational/cl_RA.h
src/rational/elem/cl_RA_equal.cc
src/rational/elem/cl_RA_minusp.cc
src/rational/elem/cl_RA_plusp.cc
src/rational/elem/cl_RA_zerop.cc
src/rational/input/cl_RA_from_string.cc
src/rational/input/cl_RA_read_stream.cc
src/rational/misc/cl_RA_as.cc
src/rational/ring/cl_RA_ring.cc
src/rational/transcendental/cl_I_logp.cc
src/rational/transcendental/cl_RA_logp.cc
src/real/cl_R.h
src/real/elem/cl_R_equal.cc
src/real/elem/cl_R_minusp.cc
src/real/elem/cl_R_plusp.cc
src/real/elem/cl_R_zerop.cc
src/real/format-output/cl_fmt_cardinal.cc
src/real/format-output/cl_fmt_floatstring.cc
src/real/format-output/cl_fmt_integer.cc
src/real/format-output/cl_fmt_paddedstring.cc
src/real/format-output/cl_format.h
src/real/input/cl_R_from_string.cc
src/real/input/cl_R_read.cc
src/real/input/cl_R_read_stream.cc
src/real/misc/cl_R_as.cc
src/real/misc/cl_R_expt_I.cc
src/real/ring/cl_R_ring.cc
tests/main.cc
tests/test_I_isqrt.cc
tests/test_I_sqrtp.cc

index 1efc991c386dab49adab62d12e08331cf13e5a67..b0613b68bbe9417192e8b5db7660c0acf5f5f08a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-08-01  Richard B. Kreckel  <kreckel@ginac.de>
+
+       * */*: Remove cl_boolean, cl_true, and cl_false in favor of built-in
+       C++ bool, true, and false.
+
 2007-07-28  Richard B. Kreckel  <kreckel@ginac.de>
 
        Remove exception hooks in favor of real C++ exceptions:
diff --git a/NEWS b/NEWS
index 7732c2d5c47483bc85d8d34329f65c4834cb8fea..faef15abdac5221688600c57ff1bfa6c62066dec 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ Implementation changes
 
 * Added support for huge numbers...
 * CLN now uses C++ exceptions for error handling.
+* Removed cl_boolean. Use built-in C++ bool instead.
 * Dropped the cln-config script. Please use pkg-config instead.
 
 
index 8e42b1e253772187201139043685648a7d69780e..f2f3495685835626383a128ce21aeb429103098b 100644 (file)
@@ -968,7 +968,7 @@ Returns a 32-bit hash code that is the same for any two numbers which are
 the same according to @code{==}. This hash code depends on the number's value,
 not its type or precision.
 
-@item cl_boolean zerop (const @var{type}& x)
+@item bool zerop (const @var{type}& x)
 @cindex @code{zerop ()}
 Compare against zero: @code{x == 0}
 @end table
@@ -993,11 +993,11 @@ Compares @code{x} and @code{y}. Returns +1 if @code{x}>@code{y},
 @cindex @code{operator > ()}
 Comparison, as in C and C++.
 
-@item cl_boolean minusp (const @var{type}& x)
+@item bool minusp (const @var{type}& x)
 @cindex @code{minusp ()}
 Compare against zero: @code{x < 0}
 
-@item cl_boolean plusp (const @var{type}& x)
+@item bool plusp (const @var{type}& x)
 @cindex @code{plusp ()}
 Compare against zero: @code{x > 0}
 
@@ -1255,7 +1255,7 @@ floating-point approximation.
 The classes @code{cl_RA}, @code{cl_I} define the following operation:
 
 @table @code
-@item cl_boolean sqrtp (const @var{type}& x, @var{type}* root)
+@item bool sqrtp (const @var{type}& x, @var{type}* root)
 @cindex @code{sqrtp ()}
 This tests whether @code{x} is a perfect square. If so, it returns true
 and the exact square root in @code{*root}, else it returns false.
@@ -1264,7 +1264,7 @@ and the exact square root in @code{*root}, else it returns false.
 Furthermore, for integers, similarly:
 
 @table @code
-@item cl_boolean isqrt (const @var{type}& x, @var{type}* root)
+@item bool isqrt (const @var{type}& x, @var{type}* root)
 @cindex @code{isqrt ()}
 @code{x} should be >= 0. This function sets @code{*root} to
 @code{floor(sqrt(x))} and returns the same value as @code{sqrtp}:
@@ -1275,7 +1275,7 @@ For @code{n}th roots, the classes @code{cl_RA}, @code{cl_I}
 define the following operation:
 
 @table @code
-@item cl_boolean rootp (const @var{type}& x, const cl_I& n, @var{type}* root)
+@item bool rootp (const @var{type}& x, const cl_I& n, @var{type}* root)
 @cindex @code{rootp ()}
 @code{x} must be >= 0. @code{n} must be > 0.
 This tests whether @code{x} is an @code{n}th power of a rational number.
@@ -1778,12 +1778,12 @@ which combines two bits into one bit): @code{boole_clr}, @code{boole_set},
 Other functions that view integers as bit strings:
 
 @table @code
-@item cl_boolean logtest (const cl_I& x, const cl_I& y)
+@item bool logtest (const cl_I& x, const cl_I& y)
 @cindex @code{logtest ()}
 Returns true if some bit is set in both @code{x} and @code{y}, i.e. if
 @code{logand(x,y) != 0}.
 
-@item cl_boolean logbitp (const cl_I& n, const cl_I& x)
+@item bool logbitp (const cl_I& n, const cl_I& x)
 @cindex @code{logbitp ()}
 Returns true if the @code{n}th bit (from the right) of @code{x} is set.
 Bit 0 is the least significant bit.
@@ -1810,7 +1810,7 @@ The constructor @code{cl_byte(size,position)} constructs a @code{cl_byte}.
 extracts the bits of @code{n} described by the bit interval @code{b}
 and returns them as a nonnegative integer with @code{b.size} bits.
 
-@item cl_boolean ldb_test (const cl_I& n, const cl_byte& b)
+@item bool ldb_test (const cl_I& n, const cl_byte& b)
 @cindex @code{ldb_test ()}
 Returns true if some bit described by the bit interval @code{b} is set in
 @code{n}.
@@ -1852,12 +1852,12 @@ The following operations on integers as bit strings are efficient shortcuts
 for common arithmetic operations:
 
 @table @code
-@item cl_boolean oddp (const cl_I& x)
+@item bool oddp (const cl_I& x)
 @cindex @code{oddp ()}
 Returns true if the least significant bit of @code{x} is 1. Equivalent to
 @code{mod(x,2) != 0}.
 
-@item cl_boolean evenp (const cl_I& x)
+@item bool evenp (const cl_I& x)
 @cindex @code{evenp ()}
 Returns true if the least significant bit of @code{x} is 0. Equivalent to
 @code{mod(x,2) == 0}.
@@ -1925,9 +1925,9 @@ value, in the following sense: If @code{a} and @code{b} are non-zero, and
 This function returns the least common multiple of @code{a} and @code{b},
 normalized to be >= 0.
 
-@item cl_boolean logp (const cl_I& a, const cl_I& b, cl_RA* l)
+@item bool logp (const cl_I& a, const cl_I& b, cl_RA* l)
 @cindex @code{logp ()}
-@itemx cl_boolean logp (const cl_RA& a, const cl_RA& b, cl_RA* l)
+@itemx bool logp (const cl_RA& a, const cl_RA& b, cl_RA* l)
 @code{a} must be > 0. @code{b} must be >0 and != 1. If log(a,b) is
 rational number, this function returns true and sets *l = log(a,b), else
 it returns false.
@@ -1945,7 +1945,7 @@ $\left({a\over b}\right)$,
 @code{a,b} must be integers, @code{b>0} and odd. The result is 0
 iff gcd(a,b)>1.
 
-@item cl_boolean isprobprime (const cl_I& n)
+@item bool isprobprime (const cl_I& n)
 @cindex prime
 @cindex @code{isprobprime()}
 Returns true if @code{n} is a small prime or passes the Miller-Rabin 
@@ -2485,7 +2485,7 @@ The float format used when reading floats with exponent marker @samp{e}.
 @item float_format_t float_flags.default_lfloat_format
 The float format used when reading floats with exponent marker @samp{l}.
 
-@item cl_boolean float_flags.mantissa_dependent_float_format
+@item bool float_flags.mantissa_dependent_float_format
 When this flag is true, floats specified with more digits than corresponding
 to the exponent marker they contain, but without @var{_nnn} suffix, will get a
 precision corresponding to their number of significant digits.
@@ -2557,12 +2557,12 @@ The structure type @code{cl_print_flags} contains the following fields:
 @item unsigned int rational_base
 The base in which rational numbers are printed. Default is @code{10}.
 
-@item cl_boolean rational_readably
+@item bool rational_readably
 If this flag is true, rational numbers are printed with radix specifiers in
 Common Lisp syntax (@code{#@var{n}R} or @code{#b} or @code{#o} or @code{#x}
 prefixes, trailing dot). Default is false.
 
-@item cl_boolean float_readably
+@item bool float_readably
 If this flag is true, type specific exponent markers have precedence over 'E'.
 Default is false.
 
@@ -2570,7 +2570,7 @@ Default is false.
 Floating point numbers of this format will be printed using the 'E' exponent
 marker. Default is @code{float_format_ffloat}.
 
-@item cl_boolean complex_readably
+@item bool complex_readably
 If this flag is true, complex numbers will be printed using the Common Lisp
 syntax @code{#C(@var{realpart} @var{imagpart})}. Default is false.
 
@@ -2606,11 +2606,11 @@ Given a ring @code{R}, the following members can be used.
 @table @code
 @item void R->fprint (std::ostream& stream, const cl_ring_element& x)
 @cindex @code{fprint ()}
-@itemx cl_boolean R->equal (const cl_ring_element& x, const cl_ring_element& y)
+@itemx bool R->equal (const cl_ring_element& x, const cl_ring_element& y)
 @cindex @code{equal ()}
 @itemx cl_ring_element R->zero ()
 @cindex @code{zero ()}
-@itemx cl_boolean R->zerop (const cl_ring_element& x)
+@itemx bool R->zerop (const cl_ring_element& x)
 @cindex @code{zerop ()}
 @itemx cl_ring_element R->plus (const cl_ring_element& x, const cl_ring_element& y)
 @cindex @code{plus ()}
@@ -2653,7 +2653,7 @@ Type tests can be performed for any of @code{cl_C_ring}, @code{cl_R_ring},
 @code{cl_RA_ring}, @code{cl_I_ring}:
 
 @table @code
-@item cl_boolean instanceof (const cl_number& x, const cl_number_ring& R)
+@item bool instanceof (const cl_number& x, const cl_number_ring& R)
 @cindex @code{instanceof ()}
 Tests whether the given number is an element of the number ring R.
 @end table
@@ -2817,7 +2817,7 @@ or an error message is issued.
 Compares two modular integers, belonging to the same modular integer ring,
 for equality.
 
-@item cl_boolean zerop (const cl_MI& x)
+@item bool zerop (const cl_MI& x)
 @cindex @code{zerop ()}
 Returns true if @code{x} is @code{0 mod N}.
 @end table
@@ -3120,7 +3120,7 @@ Returns the square of a univariate polynomial.
 Compares two univariate polynomials, belonging to the same univariate
 polynomial ring, for equality.
 
-@item cl_boolean zerop (const cl_UP& x)
+@item bool zerop (const cl_UP& x)
 @cindex @code{zerop ()}
 Returns true if @code{x} is @code{0 in R}.
 
@@ -3697,11 +3697,11 @@ exception @code{floating_point_underflow_exception} (subclass of
 @code{floating_point_exception}) to be thrown. If you set the global
 variable
 @example
-cl_boolean cl_inhibit_floating_point_underflow
+bool cl_inhibit_floating_point_underflow
 @end example
-to @code{cl_true}, the exception will be inhibited, and a floating-point
+to @code{true}, the exception will be inhibited, and a floating-point
 zero will be generated instead.  The default value of 
-@code{cl_inhibit_floating_point_underflow} is @code{cl_false}.
+@code{cl_inhibit_floating_point_underflow} is @code{false}.
 
 
 @section Customizing I/O
index 6820e1856db10f355916da1fdbc5b8e0ecf4a6bc..18868a9ac4ebf0dc1c333884ae6f1a87ebf3f9c5 100644 (file)
@@ -14,7 +14,7 @@ CL_DEFINE_AS_CONVERSION(cl_N)
 
 
 // zerop(x) testet, ob (= x 0).
-extern cl_boolean zerop (const cl_N& x);
+extern bool zerop (const cl_N& x);
 
 
 // Liefert zu reellen Zahlen a und b die komplexe Zahl a+bi.
@@ -68,7 +68,7 @@ extern const cl_N signum (const cl_N& x);
 extern const cl_N sqrt (const cl_N& x);
 
 // equal(x,y) vergleicht zwei Zahlen x und y auf Gleichheit.
-extern cl_boolean equal (const cl_N& x, const cl_N& y);
+extern bool equal (const cl_N& x, const cl_N& y);
 // equal_hashcode(x) liefert einen equal-invarianten Hashcode für x.
 extern uint32 equal_hashcode (const cl_N& x);
 
index 30534b586b495636bbf028115ecab49c23d4e18c..023261b0b8078e4926b38c3539b86396ad5ced59 100644 (file)
@@ -37,13 +37,13 @@ inline bool operator> (const cl_DF& x, const cl_DF& y)
        { return compare(x,y)>0; }
 
 // minusp(x) == (< x 0)
-extern cl_boolean minusp (const cl_DF& x);
+extern bool minusp (const cl_DF& x);
 
 // zerop(x) stellt fest, ob ein Double-Float x = 0.0 ist.
-extern cl_boolean zerop (const cl_DF& x);
+extern bool zerop (const cl_DF& x);
 
 // plusp(x) == (> x 0)
-extern cl_boolean plusp (const cl_DF& x);
+extern bool plusp (const cl_DF& x);
 
 // Liefert zu zwei Double-Float x und y : (+ x y), ein DF.
 extern const cl_DF operator+ (const cl_DF& x, const cl_DF& y);
index 515fb3730d58aead73604d05cb882e809888c1c1..c189f3905ca150f41347aa9f5168d644cc91b4a2 100644 (file)
@@ -15,8 +15,8 @@ public:
 // Assignment operators.
        cl_DF& operator= (const cl_DF&);
 // Optimization of method pointer_p().
-       cl_boolean pointer_p() const
-               { return cl_true; }
+       bool pointer_p() const
+               { return true; }
 // Faster pointer_p() gives a faster copy constructor (but not destructor!!!).
        cl_DF (const cl_DF& x);
 // Constructors and assignment operators from C numeric types.
index a9ade1c02bd0379ddce90428246fa494766b8cbe..d85cdbbbffffbbba88850b0577f73ef646a356f9 100644 (file)
@@ -37,13 +37,13 @@ inline bool operator> (const cl_FF& x, const cl_FF& y)
        { return compare(x,y)>0; }
 
 // minusp(x) == (< x 0)
-extern cl_boolean minusp (const cl_FF& x);
+extern bool minusp (const cl_FF& x);
 
 // zerop(x) stellt fest, ob ein Single-Float x = 0.0 ist.
-extern cl_boolean zerop (const cl_FF& x);
+extern bool zerop (const cl_FF& x);
 
 // plusp(x) == (> x 0)
-extern cl_boolean plusp (const cl_FF& x);
+extern bool plusp (const cl_FF& x);
 
 // Liefert zu zwei Single-Float x und y : (+ x y), ein FF.
 extern const cl_FF operator+ (const cl_FF& x, const cl_FF& y);
index 94cbfd80a112c1e644656ce736c0eecbdd8eae27..f53b7fd512e165983943573fd02b28df0a35b1f6 100644 (file)
@@ -15,11 +15,11 @@ public:
 // Assignment operators.
        cl_FF& operator= (const cl_FF&);
 // Optimization of method pointer_p().
-       cl_boolean pointer_p() const
+       bool pointer_p() const
 #if defined(CL_WIDE_POINTERS)
-               { return cl_false; }
+               { return false; }
 #else
-               { return cl_true; }
+               { return true; }
 #endif
 // Faster pointer_p() gives a faster copy constructor (but not destructor!!!).
        cl_FF (const cl_FF& x);
index 383f1f27bf468f29e4b2fe1b394473a7dd4dc930..1c981ed046c90def12eb8464c4e3eea181cff28a 100644 (file)
@@ -31,13 +31,13 @@ struct cl_idecoded_float {
 
 
 // zerop(x) testet, ob (= x 0).
-extern cl_boolean zerop (const cl_F& x);
+extern bool zerop (const cl_F& x);
 
 // minusp(x) testet, ob (< x 0).
-extern cl_boolean minusp (const cl_F& x);
+extern bool minusp (const cl_F& x);
 
 // plusp(x) testet, ob (> x 0).
-extern cl_boolean plusp (const cl_F& x);
+extern bool plusp (const cl_F& x);
 
 
 // cl_F_to_SF(x) wandelt ein Float x in ein Short-Float um und rundet dabei.
@@ -764,7 +764,7 @@ CL_REQUIRE(cl_ieee)
 
 
 // If this is true, floating point underflow returns zero instead of throwing an exception.
-extern cl_boolean cl_inhibit_floating_point_underflow;
+extern bool cl_inhibit_floating_point_underflow;
 
 }  // namespace cln
 
index 5df0ab9f66dc5d16a4fb94709f9e471acc3e6e4e..71fb90aa7ed296e5f5958dced26be546d2d00e57 100644 (file)
@@ -17,7 +17,7 @@ struct cl_read_float_flags {
        // Flag whether floats specified with more digits than corresponding
        // to the exponent marker they contain, but without _nnn suffix, will
        // get a precision corresponding to their number of significant digits.
-       cl_boolean mantissa_dependent_float_format;
+       bool mantissa_dependent_float_format;
 };
 
 // Specifies the possible results of a read operation.
index f470442f9f991820506b0c152ec5d069dfabffbc..bf72106d551534be3e463f8d5de9c68110794271 100644 (file)
@@ -146,21 +146,21 @@ extern const cl_I boole (cl_boole op, const cl_I& x, const cl_I& y);
 // Prüft, ob (LOGTEST x y), wo x und y Integers sind.
 // (LOGTEST x y) = (NOT (ZEROP (LOGAND x y))).
 // < ergebnis: /=0, falls ja; =0, falls nein.
-extern cl_boolean logtest (const cl_I& x, const cl_I& y);
+extern bool 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 (uintC x, const cl_I& y);
-extern cl_boolean logbitp (const cl_I& x, const cl_I& y);
+extern bool logbitp (uintC x, const cl_I& y);
+extern bool logbitp (const cl_I& x, const cl_I& y);
 
 // Prüft, ob (ODDP x), wo x ein Integer ist.
 // Ergebnis: /=0, falls ja; =0, falls nein.
-extern cl_boolean oddp (const cl_I& x);
+extern bool oddp (const cl_I& x);
 
 // Prüft, ob (EVENP x), wo x ein Integer ist.
 // Ergebnis: /=0, falls ja; =0, falls nein.
-inline cl_boolean evenp (const cl_I& x)
-       { return (cl_boolean) (!oddp(x)); }
+inline bool evenp (const cl_I& x)
+       { return !oddp(x); }
 
 // (ASH x y), wo x und y Integers sind. Ergebnis Integer.
 extern const cl_I ash (const cl_I& x, sintC y);
@@ -293,7 +293,7 @@ inline const cl_I operator>> (const cl_I& x, const cl_I& y) // assume y >= 0
 // Vergleich von Integers
 
 // equal(x,y) vergleicht zwei Integers x und y auf Gleichheit.
-extern cl_boolean equal (const cl_I& x, const cl_I& y);
+extern bool equal (const cl_I& x, const cl_I& y);
 // equal_hashcode(x) liefert einen equal-invarianten Hashcode für x.
 extern uint32 equal_hashcode (const cl_I& x);
 
@@ -315,13 +315,13 @@ inline bool operator> (const cl_I& x, const cl_I& y)
        { return compare(x,y)>0; }
 
 // minusp(x) == (< x 0)
-extern cl_boolean minusp (const cl_I& x);
+extern bool minusp (const cl_I& x);
 
 // plusp(x) == (> x 0)
-extern cl_boolean plusp (const cl_I& x);
+extern bool plusp (const cl_I& x);
 
 // zerop(x) stellt fest, ob ein Integer = 0 ist.
-extern cl_boolean zerop (const cl_I& x);
+extern bool zerop (const cl_I& x);
 
 
 // BYTE-Operationen auf Integers
@@ -337,8 +337,8 @@ struct cl_byte {
 extern const cl_I ldb (const cl_I& n, const cl_byte& b);
 
 // ldb_test(n,byte) führt (LDB-TEST byte n) aus, wobei n ein Integer ist.
-// Ergebnis: cl_false wenn nein (also alle fraglichen Bits =0), cl_true wenn ja.
-extern cl_boolean ldb_test (const cl_I& n, const cl_byte& b);
+// Ergebnis: false wenn nein (also alle fraglichen Bits =0), true wenn ja.
+extern bool ldb_test (const cl_I& n, const cl_byte& b);
 
 // (MASK-FIELD byte n), wo n ein Integer ist.
 extern const cl_I mask_field (const cl_I& n, const cl_byte& b);
@@ -529,8 +529,8 @@ public:
 // isqrt(x,&w)
 // > x: Integer (sollte >=0 sein)
 // < w: (isqrt x)
-// < ergebnis: cl_true falls x Quadratzahl, cl_false sonst
-  extern cl_boolean isqrt (const cl_I& x, cl_I* w);
+// < ergebnis: true falls x Quadratzahl, false sonst
+  extern bool isqrt (const cl_I& x, cl_I* w);
 // Wenn das boolesche Ergebnis uninteressant ist:
   inline const cl_I isqrt (const cl_I& x) { cl_I w; isqrt(x,&w); return w; }
 
@@ -538,17 +538,17 @@ public:
 // sqrtp(x,&w)
 // > x: ein Integer >=0
 // < w: Integer (sqrt x) falls x Quadratzahl
-// < ergebnis: cl_true   ..................., cl_false sonst
-  extern cl_boolean sqrtp (const cl_I& x, cl_I* w);
+// < ergebnis: true      ..................., false sonst
+  extern bool sqrtp (const cl_I& x, cl_I* w);
 
 // Stellt fest, ob ein Integer >=0 eine n-te Potenz ist.
 // rootp(x,n,&w)
 // > x: ein Integer >=0
 // > n: ein Integer >0
 // < w: Integer (expt x (/ n)) falls x eine n-te Potenz
-// < ergebnis: cl_true         ........................, cl_false sonst
-  extern cl_boolean rootp (const cl_I& x, uintL n, cl_I* w);
-  extern cl_boolean rootp (const cl_I& x, const cl_I& n, cl_I* w);
+// < ergebnis: true            ........................, false sonst
+  extern bool rootp (const cl_I& x, uintL n, cl_I* w);
+  extern bool rootp (const cl_I& x, const cl_I& n, cl_I* w);
 
 
 // max(x,y) liefert (max x y), wo x und y ganze Zahlen sind.
index 58d1e8938dcce062c3fb1296b1322a9da5036d15..e09dc7c6327fe5fb0cb7f8495f39ad39a10945d9 100644 (file)
@@ -37,13 +37,13 @@ inline bool operator> (const cl_LF& x, const cl_LF& y)
        { return compare(x,y)>0; }
 
 // minusp(x) == (< x 0)
-extern cl_boolean minusp (const cl_LF& x);
+extern bool minusp (const cl_LF& x);
 
 // zerop(x) stellt fest, ob ein Long-Float x = 0.0 ist.
-extern cl_boolean zerop (const cl_LF& x);
+extern bool zerop (const cl_LF& x);
 
 // plusp(x) == (> x 0)
-extern cl_boolean plusp (const cl_LF& x);
+extern bool plusp (const cl_LF& x);
 
 // Liefert zu zwei Long-Float x und y : (+ x y), ein LF.
 extern const cl_LF operator+ (const cl_LF& x, const cl_LF& y);
index e73f0a1f70922e8bedd404e15ea908db4375ba40..cd34668bb0149b3fbd773706060347f5f03de57f 100644 (file)
@@ -15,8 +15,8 @@ public:
 // Assignment operators.
        cl_LF& operator= (const cl_LF&);
 // Optimization of method pointer_p().
-       cl_boolean pointer_p() const
-               { return cl_true; }
+       bool pointer_p() const
+               { return true; }
 // Faster pointer_p() gives a faster copy constructor (but not destructor!!!).
        cl_LF (const cl_LF& x);
 // Other constructors.
index ade02d881e200af7c90ebe6cbf2583dcb2d35942..877e7e9db640f6dfc64bb42ed6a55feb359bc391 100644 (file)
@@ -153,14 +153,14 @@ struct _cl_modint_setops /* cf. _cl_ring_setops */ {
        // print
        void (* fprint) (cl_heap_modint_ring* R, std::ostream& stream, const _cl_MI& x);
        // equality
-       cl_boolean (* equal) (cl_heap_modint_ring* R, const _cl_MI& x, const _cl_MI& y);
+       bool (* equal) (cl_heap_modint_ring* R, const _cl_MI& x, const _cl_MI& y);
        // random number
        const _cl_MI (* random) (cl_heap_modint_ring* R, random_state& randomstate);
 };
 struct _cl_modint_addops /* cf. _cl_ring_addops */ {
        // 0
        const _cl_MI (* zero) (cl_heap_modint_ring* R);
-       cl_boolean (* zerop) (cl_heap_modint_ring* R, const _cl_MI& x);
+       bool (* zerop) (cl_heap_modint_ring* R, const _cl_MI& x);
        // x+y
        const _cl_MI (* plus) (cl_heap_modint_ring* R, const _cl_MI& x, const _cl_MI& y);
        // x-y
@@ -216,13 +216,13 @@ public:
        // Low-level operations.
        void _fprint (std::ostream& stream, const _cl_MI& x)
                { setops->fprint(this,stream,x); }
-       cl_boolean _equal (const _cl_MI& x, const _cl_MI& y)
+       bool _equal (const _cl_MI& x, const _cl_MI& y)
                { return setops->equal(this,x,y); }
        const _cl_MI _random (random_state& randomstate)
                { return setops->random(this,randomstate); }
        const _cl_MI _zero ()
                { return addops->zero(this); }
-       cl_boolean _zerop (const _cl_MI& x)
+       bool _zerop (const _cl_MI& x)
                { return addops->zerop(this,x); }
        const _cl_MI _plus (const _cl_MI& x, const _cl_MI& y)
                { return addops->plus(this,x,y); }
@@ -256,7 +256,7 @@ public:
                if (!(x.ring() == this)) throw runtime_exception();
                _fprint(stream,x);
        }
-       cl_boolean equal (const cl_MI& x, const cl_MI& y)
+       bool equal (const cl_MI& x, const cl_MI& y)
        {
                if (!(x.ring() == this)) throw runtime_exception();
                if (!(y.ring() == this)) throw runtime_exception();
@@ -270,7 +270,7 @@ public:
        {
                return cl_MI(this,_zero());
        }
-       cl_boolean zerop (const cl_MI& x)
+       bool zerop (const cl_MI& x)
        {
                if (!(x.ring() == this)) throw runtime_exception();
                return _zerop(x);
@@ -407,7 +407,7 @@ inline bool operator!= (const cl_I& x, const cl_MI& y)
        { return !y.ring()->equal(y.ring()->canonhom(x),y); }
 
 // Compare against 0.
-inline cl_boolean zerop (const cl_MI& x)
+inline bool zerop (const cl_MI& x)
        { return x.ring()->zerop(x); }
 
 // Multiply.
index 8ae3ac88009ecc402959b3f96aa4c4cbe6baa8f6..86b8324972cfefe969c3ed3ede3374b240830702 100644 (file)
@@ -21,7 +21,7 @@ namespace cln {
 // isprobprime(n), n integer > 0,
 // returns true when n is probably prime.
 // This is pretty quick, but no caching is done.
-  extern cl_boolean isprobprime (const cl_I& n);
+  extern bool isprobprime (const cl_I& n);
 
 // nextprobprime(x) returns the smallest probable prime >= x.
   extern const cl_I nextprobprime (const cl_R& x);
index 52f72ef8b4726bbf9a1d3a1467336cda5429b864..bb5a24216ceab8e22cf3c8587051f420f1565083 100644 (file)
@@ -71,13 +71,13 @@ typedef uintP  cl_uint;  // This ought to be called `cl_word'.
 #endif
 
 // Distinguish immediate data from pointers.
-inline cl_boolean cl_pointer_p (cl_uint word)
+inline bool cl_pointer_p (cl_uint word)
 {
-       return (cl_boolean)((word & (cl_word_alignment-1)) == 0);
+       return (word & (cl_word_alignment-1)) == 0;
 }
-inline cl_boolean cl_immediate_p (cl_uint word)
+inline bool cl_immediate_p (cl_uint word)
 {
-       return (cl_boolean)((word & (cl_word_alignment-1)) != 0);
+       return (word & (cl_word_alignment-1)) != 0;
 }
 
 // Immediate data: Fixnum, Short Float, maybe Single Float.
@@ -310,7 +310,7 @@ public:
 // Assignment operator.
        cl_gcobject& operator= (const cl_gcobject&);
 // Distinguish immediate data from pointer.
-       cl_boolean pointer_p() const
+       bool pointer_p() const
                { return cl_pointer_p(word); }
 // Reference counting.
        void inc_pointer_refcount () const
@@ -360,8 +360,8 @@ public:
 // Assignment operator.
        cl_gcpointer& operator= (const cl_gcpointer&);
 // Distinguish immediate data from pointer.
-       cl_boolean pointer_p() const
-               { return cl_true; }
+       bool pointer_p() const
+               { return true; }
 // Reference counting.
        void inc_pointer_refcount () const
                { cl_inc_pointer_refcount(heappointer); }
@@ -410,7 +410,7 @@ public:
 // Assignment operator.
        cl_rcobject& operator= (const cl_rcobject&);
 // Distinguish immediate data from pointer.
-       cl_boolean pointer_p() const
+       bool pointer_p() const
                { return cl_pointer_p(word); }
 // Reference counting.
        void inc_pointer_refcount () const
@@ -460,8 +460,8 @@ public:
 // Assignment operator.
        cl_rcpointer& operator= (const cl_rcpointer&);
 // Distinguish immediate data from pointer.
-       cl_boolean pointer_p() const
-               { return cl_true; }
+       bool pointer_p() const
+               { return true; }
 // Reference counting.
        void inc_pointer_refcount () const
                { cl_inc_pointer_refcount(heappointer); }
index 907f47f20a89192c969011370a2a26fbd6ed52eb..ff65988661d109f5a8d49be77ad2ec78e40860b9 100644 (file)
@@ -15,21 +15,21 @@ struct cl_print_rational_flags {
        unsigned int rational_base;
        // Flag whether to print radix specifiers in Common Lisp syntax for
        // rational numbers (#nR or #b or #o or #x prefixes, trailing dot).
-       cl_boolean rational_readably;
+       bool rational_readably;
 // Constructor.
        cl_print_rational_flags () :
                rational_base (10),
-               rational_readably (cl_false) {}
+               rational_readably (false) {}
 };
 
 struct cl_print_float_flags {
        // Flag whether to prefer type specific exponent markers over 'E'.
-       cl_boolean float_readably;
+       bool float_readably;
        // If !float_readably, the format which earns the 'E' exponent marker.
        float_format_t default_float_format;
 // Constructor.
        cl_print_float_flags () :
-               float_readably (cl_false),
+               float_readably (false),
                default_float_format (float_format_ffloat) {}
 };
 
@@ -37,10 +37,10 @@ struct cl_print_real_flags : cl_print_rational_flags, cl_print_float_flags {};
 
 struct cl_print_complex_flags {
        // Flag whether to use the Common Lisp #C(realpart imagpart) syntax,
-       cl_boolean complex_readably;
+       bool complex_readably;
 // Constructor.
        cl_print_complex_flags () :
-               complex_readably (cl_false) {}
+               complex_readably (false) {}
 };
 
 struct cl_print_number_flags : cl_print_real_flags, cl_print_complex_flags {};
index bccce7ff0d82f39c03534c5259c4ec41468e2b99..b09962d2fbea87efc7153c0166def994d5506fc5 100644 (file)
@@ -97,7 +97,7 @@ extern const cl_RA minus1 (const cl_RA& r);
 extern const cl_RA abs (const cl_RA& r);
 
 // equal(r,s) vergleicht zwei rationale Zahlen r und s auf Gleichheit.
-extern cl_boolean equal (const cl_RA& r, const cl_RA& s);
+extern bool equal (const cl_RA& r, const cl_RA& s);
 // equal_hashcode(r) liefert einen equal-invarianten Hashcode für r.
 extern uint32 equal_hashcode (const cl_RA& r);
 
@@ -119,13 +119,13 @@ inline bool operator> (const cl_RA& x, const cl_RA& y)
        { return compare(x,y)>0; }
 
 // minusp(x) == (< x 0)
-extern cl_boolean minusp (const cl_RA& x);
+extern bool minusp (const cl_RA& x);
 
 // zerop(x) stellt fest, ob eine rationale Zahl = 0 ist.
-extern cl_boolean zerop (const cl_RA& x);
+extern bool zerop (const cl_RA& x);
 
 // plusp(x) == (> x 0)
-extern cl_boolean plusp (const cl_RA& x);
+extern bool plusp (const cl_RA& x);
 
 // Kehrwert (/ r), wo r eine rationale Zahl ist.
 extern const cl_RA recip (const cl_RA& r);
@@ -277,8 +277,8 @@ extern const cl_RA expt (const cl_RA& x, const cl_I& y);
 // sqrtp(x,&w)
 // > x: eine rationale Zahl >=0
 // < w: rationale Zahl (sqrt x) falls x Quadratzahl
-// < ergebnis: cl_true   ..................., cl_false sonst
-  extern cl_boolean sqrtp (const cl_RA& x, cl_RA* w);
+// < ergebnis: true      ..................., false sonst
+  extern bool sqrtp (const cl_RA& x, cl_RA* w);
 
 // Stellt fest, ob eine rationale Zahl >=0 die n-te Potenz einer rationalen Zahl
 // ist.
@@ -286,9 +286,9 @@ extern const cl_RA expt (const cl_RA& x, const cl_I& y);
 // > x: eine rationale Zahl >=0
 // > n: ein Integer >0
 // < w: exakte n-te Wurzel (expt x (/ n)) falls x eine n-te Potenz
-// < ergebnis: cl_true                    ........................, cl_false sonst
-  extern cl_boolean rootp (const cl_RA& x, uintL n, cl_RA* w);
-  extern cl_boolean rootp (const cl_RA& x, const cl_I& n, cl_RA* w);
+// < ergebnis: true                       ........................, false sonst
+  extern bool rootp (const cl_RA& x, uintL n, cl_RA* w);
+  extern bool rootp (const cl_RA& x, const cl_I& n, cl_RA* w);
 
 // Liefert zu Integers a>0, b>1 den Logarithmus log(a,b),
 // falls er eine rationale Zahl ist.
@@ -296,8 +296,8 @@ extern const cl_RA expt (const cl_RA& x, const cl_I& y);
 // > a: ein Integer >0
 // > b: ein Integer >1
 // < l: log(a,b)       falls er eine exakte rationale Zahl ist
-// < ergebnis: cl_true ......................................., cl_false sonst
-  extern cl_boolean logp (const cl_I& a, const cl_I& b, cl_RA* l);
+// < ergebnis: true    ......................................., false sonst
+  extern bool logp (const cl_I& a, const cl_I& b, cl_RA* l);
 
 // Liefert zu rationalen Zahlen a>0, b>0 den Logarithmus log(a,b),
 // falls er eine rationale Zahl ist.
@@ -305,8 +305,8 @@ extern const cl_RA expt (const cl_RA& x, const cl_I& y);
 // > a: eine rationale Zahl >0
 // > b: eine rationale Zahl >0, /=1
 // < l: log(a,b)       falls er eine exakte rationale Zahl ist
-// < ergebnis: cl_true ......................................., cl_false sonst
-  extern cl_boolean logp (const cl_RA& a, const cl_RA& b, cl_RA* l);
+// < ergebnis: true    ......................................., false sonst
+  extern bool logp (const cl_RA& a, const cl_RA& b, cl_RA* l);
 
 // Konversion zu einem C "float".
 extern float float_approx (const cl_RA& x);
index d89cfeffdf3b4ffb3507bce1e30e6d0fd020f403..e2637f200ef0f032e5c7c55acadbcb1612b13c1e 100644 (file)
@@ -17,13 +17,13 @@ CL_DEFINE_AS_CONVERSION(cl_R)
 
 
 // zerop(x) testet, ob (= x 0).
-extern cl_boolean zerop (const cl_R& x);
+extern bool zerop (const cl_R& x);
 
 // minusp(x) testet, ob (< x 0).
-extern cl_boolean minusp (const cl_R& x);
+extern bool minusp (const cl_R& x);
 
 // plusp(x) testet, ob (> x 0).
-extern cl_boolean plusp (const cl_R& x);
+extern bool plusp (const cl_R& x);
 
 
 // R_to_SF(x) wandelt eine reelle Zahl x in ein Short-Float um.
@@ -361,7 +361,7 @@ inline const cl_RA rational (const cl_RA& x) { return x; }
 
 
 // equal(x,y) vergleicht zwei reelle Zahlen x und y auf Gleichheit.
-extern cl_boolean equal (const cl_R& x, const cl_R& y);
+extern bool equal (const cl_R& x, const cl_R& y);
 // equal_hashcode(x) liefert einen equal-invarianten Hashcode für x.
 extern uint32 equal_hashcode (const cl_R& x);
 
index 8c7fbbb7a9546946e3b91f9d0492b7fe32a30b8b..fcdcac9dda82e2ef902a2e8c457fd75c2324c8d8 100644 (file)
@@ -158,13 +158,13 @@ struct _cl_ring_setops {
        // print
        void (* fprint) (cl_heap_ring* R, std::ostream& stream, const _cl_ring_element& x);
        // equality
-       cl_boolean (* equal) (cl_heap_ring* R, const _cl_ring_element& x, const _cl_ring_element& y);
+       bool (* equal) (cl_heap_ring* R, const _cl_ring_element& x, const _cl_ring_element& y);
        // ...
 };
 struct _cl_ring_addops {
        // 0
        const _cl_ring_element (* zero) (cl_heap_ring* R);
-       cl_boolean (* zerop) (cl_heap_ring* R, const _cl_ring_element& x);
+       bool (* zerop) (cl_heap_ring* R, const _cl_ring_element& x);
        // x+y
        const _cl_ring_element (* plus) (cl_heap_ring* R, const _cl_ring_element& x, const _cl_ring_element& y);
        // x-y
@@ -211,11 +211,11 @@ public:
        // Low-level operations.
        void _fprint (std::ostream& stream, const _cl_ring_element& x)
                { setops->fprint(this,stream,x); }
-       cl_boolean _equal (const _cl_ring_element& x, const _cl_ring_element& y)
+       bool _equal (const _cl_ring_element& x, const _cl_ring_element& y)
                { return setops->equal(this,x,y); }
        const _cl_ring_element _zero ()
                { return addops->zero(this); }
-       cl_boolean _zerop (const _cl_ring_element& x)
+       bool _zerop (const _cl_ring_element& x)
                { return addops->zerop(this,x); }
        const _cl_ring_element _plus (const _cl_ring_element& x, const _cl_ring_element& y)
                { return addops->plus(this,x,y); }
@@ -239,7 +239,7 @@ public:
                if (!(x.ring() == this)) throw runtime_exception();
                _fprint(stream,x);
        }
-       cl_boolean equal (const cl_ring_element& x, const cl_ring_element& y)
+       bool equal (const cl_ring_element& x, const cl_ring_element& y)
        {
                if (!(x.ring() == this)) throw runtime_exception();
                if (!(y.ring() == this)) throw runtime_exception();
@@ -249,7 +249,7 @@ public:
        {
                return cl_ring_element(this,_zero());
        }
-       cl_boolean zerop (const cl_ring_element& x)
+       bool zerop (const cl_ring_element& x)
        {
                if (!(x.ring() == this)) throw runtime_exception();
                return _zerop(x);
@@ -338,7 +338,7 @@ inline bool operator!= (const cl_ring_element& x, const cl_ring_element& y)
        { return !x.ring()->equal(x,y); }
 
 // Compare against 0.
-inline cl_boolean zerop (const cl_ring_element& x)
+inline bool zerop (const cl_ring_element& x)
        { return x.ring()->zerop(x); }
 
 // Multiply.
@@ -396,9 +396,9 @@ inline cl_ring_element::cl_ring_element ()
 
 template <class T>
 struct cl_number_ring_ops {
-       cl_boolean (* contains) (const cl_number&);
-       cl_boolean (* equal) (const T&, const T&);
-       cl_boolean (* zerop) (const T&);
+       bool (* contains) (const cl_number&);
+       bool (* equal) (const T&, const T&);
+       bool (* zerop) (const T&);
        const T (* plus) (const T&, const T&);
        const T (* minus) (const T&, const T&);
        const T (* uminus) (const T&);
@@ -427,7 +427,7 @@ public:
 };
 
 // Type test.
-inline cl_boolean instanceof (const cl_number& x, const cl_number_ring& R)
+inline bool instanceof (const cl_number& x, const cl_number_ring& R)
 {
        return ((cl_heap_number_ring*) R.heappointer)->ops->contains(x);
 }
index 4ca1bf6887e979226ea2ce85e2245e23ea3aebaf..a77fc01e5e1f4fadc9841fe11398be8fd89a366c 100644 (file)
@@ -37,13 +37,13 @@ inline bool operator> (const cl_SF& x, const cl_SF& y)
        { return compare(x,y)>0; }
 
 // minusp(x) == (< x 0)
-extern cl_boolean minusp (const cl_SF& x);
+extern bool minusp (const cl_SF& x);
 
 // zerop(x) stellt fest, ob ein Short-Float x = 0.0 ist.
-extern cl_boolean zerop (const cl_SF& x);
+extern bool zerop (const cl_SF& x);
 
 // plusp(x) == (> x 0)
-extern cl_boolean plusp (const cl_SF& x);
+extern bool plusp (const cl_SF& x);
 
 // Liefert zu zwei Short-Float x und y : (+ x y), ein SF.
 extern const cl_SF operator+ (const cl_SF& x, const cl_SF& y);
index 57266fc97fd80e8803db944ac9eab55645051470..1801ac70cc5927c028cb09a0cd82b20b0affd19a 100644 (file)
@@ -15,8 +15,8 @@ public:
 // Assignment operators.
        cl_SF& operator= (const cl_SF&);
 // Optimization of method pointer_p().
-       cl_boolean pointer_p() const
-               { return cl_false; }
+       bool pointer_p() const
+               { return false; }
 // Faster pointer_p() gives a faster copy constructor (but not destructor!!!).
        cl_SF (const cl_SF& x);
 // Other constructors.
index 067411e298f0c875e3c0cfffbc72d6dd461e5999..a64a426bd8766c2e0ed423aafd1b7df7c6b0d2c2 100644 (file)
     typedef uint64 uintQ;
   #endif
 
-// Boolean type.
-#if 1
-  typedef enum { cl_false = 0, cl_true = 1 }
-          cl_boolean;
-#else
-  typedef bool cl_boolean;
-  #define cl_false 0
-  #define cl_true  1
-#endif
-
 // Type for three values (0, +1, -1).
   typedef int  cl_signean;
   #define signean_plus  1
index 95d2ea129baf958a4e685d5704c19dbf1101d703..0116827a7052abb8fd04b97152b74020c34322ee 100644 (file)
@@ -115,12 +115,12 @@ struct _cl_univpoly_setops /* cf. _cl_ring_setops */ {
        // equality
        // (Be careful: This is not well-defined for polynomials with
        // floating-point coefficients.)
-       cl_boolean (* equal) (cl_heap_univpoly_ring* R, const _cl_UP& x, const _cl_UP& y);
+       bool (* equal) (cl_heap_univpoly_ring* R, const _cl_UP& x, const _cl_UP& y);
 };
 struct _cl_univpoly_addops /* cf. _cl_ring_addops */ {
        // 0
        const _cl_UP (* zero) (cl_heap_univpoly_ring* R);
-       cl_boolean (* zerop) (cl_heap_univpoly_ring* R, const _cl_UP& x);
+       bool (* zerop) (cl_heap_univpoly_ring* R, const _cl_UP& x);
        // x+y
        const _cl_UP (* plus) (cl_heap_univpoly_ring* R, const _cl_UP& x, const _cl_UP& y);
        // x-y
@@ -188,11 +188,11 @@ public:
        // Low-level operations.
        void _fprint (std::ostream& stream, const _cl_UP& x)
                { setops->fprint(this,stream,x); }
-       cl_boolean _equal (const _cl_UP& x, const _cl_UP& y)
+       bool _equal (const _cl_UP& x, const _cl_UP& y)
                { return setops->equal(this,x,y); }
        const _cl_UP _zero ()
                { return addops->zero(this); }
-       cl_boolean _zerop (const _cl_UP& x)
+       bool _zerop (const _cl_UP& x)
                { return addops->zerop(this,x); }
        const _cl_UP _plus (const _cl_UP& x, const _cl_UP& y)
                { return addops->plus(this,x,y); }
@@ -234,7 +234,7 @@ public:
                if (!(x.ring() == this)) throw runtime_exception();
                _fprint(stream,x);
        }
-       cl_boolean equal (const cl_UP& x, const cl_UP& y)
+       bool equal (const cl_UP& x, const cl_UP& y)
        {
                if (!(x.ring() == this)) throw runtime_exception();
                if (!(y.ring() == this)) throw runtime_exception();
@@ -244,7 +244,7 @@ public:
        {
                return cl_UP(this,_zero());
        }
-       cl_boolean zerop (const cl_UP& x)
+       bool zerop (const cl_UP& x)
        {
                if (!(x.ring() == this)) throw runtime_exception();
                return _zerop(x);
@@ -383,7 +383,7 @@ inline bool operator!= (const cl_UP& x, const cl_UP& y)
        { return !x.ring()->equal(x,y); }
 
 // Compare against 0.
-inline cl_boolean zerop (const cl_UP& x)
+inline bool zerop (const cl_UP& x)
        { return x.ring()->zerop(x); }
 
 // Multiply.
@@ -540,7 +540,7 @@ class cl_heap_univpoly_specialized_ring : public cl_heap_univpoly_ring {
        {
                cl_heap_univpoly_ring::fprint(stream,x);
        }
-       cl_boolean equal (const cl_UP_specialized<T>& x, const cl_UP_specialized<T>& y)
+       bool equal (const cl_UP_specialized<T>& x, const cl_UP_specialized<T>& y)
        {
                return cl_heap_univpoly_ring::equal(x,y);
        }
@@ -548,7 +548,7 @@ class cl_heap_univpoly_specialized_ring : public cl_heap_univpoly_ring {
        {
                return The2(cl_UP_specialized<T>)(cl_heap_univpoly_ring::zero());
        }
-       cl_boolean zerop (const cl_UP_specialized<T>& x)
+       bool zerop (const cl_UP_specialized<T>& x)
        {
                return cl_heap_univpoly_ring::zerop(x);
        }
index 6b8355b11ada75021e36b8ee6613cc08a7a4b6ce..3970d9dfac9128a095f6145ac27725aba1b9dc37 100644 (file)
@@ -64,7 +64,7 @@ class cl_heap_univpoly_complex_ring : public cl_heap_univpoly_ring {
        {
                cl_heap_univpoly_ring::fprint(stream,x);
        }
-       cl_boolean equal (const cl_UP_N& x, const cl_UP_N& y)
+       bool equal (const cl_UP_N& x, const cl_UP_N& y)
        {
                return cl_heap_univpoly_ring::equal(x,y);
        }
@@ -72,7 +72,7 @@ class cl_heap_univpoly_complex_ring : public cl_heap_univpoly_ring {
        {
                return The2(cl_UP_N)(cl_heap_univpoly_ring::zero());
        }
-       cl_boolean zerop (const cl_UP_N& x)
+       bool zerop (const cl_UP_N& x)
        {
                return cl_heap_univpoly_ring::zerop(x);
        }
index ae9db0e237ea3a88680f4db6a241eaf11236df71..08b14b5426784ebfd2f2d9c417a50d255f0280c4 100644 (file)
@@ -63,7 +63,7 @@ class cl_heap_univpoly_integer_ring : public cl_heap_univpoly_ring {
        {
                cl_heap_univpoly_ring::fprint(stream,x);
        }
-       cl_boolean equal (const cl_UP_I& x, const cl_UP_I& y)
+       bool equal (const cl_UP_I& x, const cl_UP_I& y)
        {
                return cl_heap_univpoly_ring::equal(x,y);
        }
@@ -71,7 +71,7 @@ class cl_heap_univpoly_integer_ring : public cl_heap_univpoly_ring {
        {
                return The2(cl_UP_I)(cl_heap_univpoly_ring::zero());
        }
-       cl_boolean zerop (const cl_UP_I& x)
+       bool zerop (const cl_UP_I& x)
        {
                return cl_heap_univpoly_ring::zerop(x);
        }
index e312f062421370c7df59e2adba38579ee39957ee..5df4630c5548e94b265e1deea536d6985b49f88b 100644 (file)
@@ -55,7 +55,7 @@ class cl_heap_univpoly_modint_ring : public cl_heap_univpoly_ring {
        {
                cl_heap_univpoly_ring::fprint(stream,x);
        }
-       cl_boolean equal (const cl_UP_MI& x, const cl_UP_MI& y)
+       bool equal (const cl_UP_MI& x, const cl_UP_MI& y)
        {
                return cl_heap_univpoly_ring::equal(x,y);
        }
@@ -63,7 +63,7 @@ class cl_heap_univpoly_modint_ring : public cl_heap_univpoly_ring {
        {
                return The2(cl_UP_MI)(cl_heap_univpoly_ring::zero());
        }
-       cl_boolean zerop (const cl_UP_MI& x)
+       bool zerop (const cl_UP_MI& x)
        {
                return cl_heap_univpoly_ring::zerop(x);
        }
index 1eb1a24033e9a1765ef25f6b797fc473c2902088..a1a6283f38dcaa9ff1a4f33d42667e393fa7aadc 100644 (file)
@@ -64,7 +64,7 @@ class cl_heap_univpoly_rational_ring : public cl_heap_univpoly_ring {
        {
                cl_heap_univpoly_ring::fprint(stream,x);
        }
-       cl_boolean equal (const cl_UP_RA& x, const cl_UP_RA& y)
+       bool equal (const cl_UP_RA& x, const cl_UP_RA& y)
        {
                return cl_heap_univpoly_ring::equal(x,y);
        }
@@ -72,7 +72,7 @@ class cl_heap_univpoly_rational_ring : public cl_heap_univpoly_ring {
        {
                return The2(cl_UP_RA)(cl_heap_univpoly_ring::zero());
        }
-       cl_boolean zerop (const cl_UP_RA& x)
+       bool zerop (const cl_UP_RA& x)
        {
                return cl_heap_univpoly_ring::zerop(x);
        }
index 8954e0eaa552b0612af2550b56524b40ab7b9a99..59d302cb8c62ce0f002d12189099bdce5f639b05 100644 (file)
@@ -64,7 +64,7 @@ class cl_heap_univpoly_real_ring : public cl_heap_univpoly_ring {
        {
                cl_heap_univpoly_ring::fprint(stream,x);
        }
-       cl_boolean equal (const cl_UP_R& x, const cl_UP_R& y)
+       bool equal (const cl_UP_R& x, const cl_UP_R& y)
        {
                return cl_heap_univpoly_ring::equal(x,y);
        }
@@ -72,7 +72,7 @@ class cl_heap_univpoly_real_ring : public cl_heap_univpoly_ring {
        {
                return The2(cl_UP_R)(cl_heap_univpoly_ring::zero());
        }
-       cl_boolean zerop (const cl_UP_R& x)
+       bool zerop (const cl_UP_R& x)
        {
                return cl_heap_univpoly_ring::zerop(x);
        }
index 997e3964ded3b7a051ca9a0e798e905c31aa49a0..4b9d8cf9c0dc132cdf80fa2cae69cf2ff64760ec 100644 (file)
@@ -55,15 +55,15 @@ 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 (uintC m, uintC n) // n <= m
+  static inline bool cl_recip_suitable (uintC m, uintC n) // n <= m
     { if (n < 2000)
-        return cl_false;
+        return false;
       else // when n >= 4400/(m/n)^2, i.e. (m/66)^2 > n
         { var uintC mq = floor(m,66);
           if ((mq >= bit(intCsize/2)) || (mq*mq > n))
-            return cl_true;
+            return true;
           else
-            return cl_false;
+            return false;
         }
     }
 #else
@@ -93,15 +93,15 @@ 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 (uintC m, uintC n) // n <= m
+  static inline bool cl_recip_suitable (uintC m, uintC n) // n <= m
     { if (n < 500)
-        return cl_false;
+        return false;
       else // when n >= 2100/(m/n)^2, i.e. (m/46)^2 > n
         { var uintC mq = floor(m,46);
           if ((mq >= bit(intCsize/2)) || (mq*mq > n))
-            return cl_true;
+            return true;
           else
-            return cl_false;
+            return false;
         }
     }
 #endif
index 76fbad375dc608787f18481c7ea4460056d1aefc..a36e1ee8ae2037ab0bce6b9a4245d7ba0d40be12 100644 (file)
@@ -137,9 +137,9 @@ extern uintD* clear_loop_down (uintD* destptr, uintC count);
 
 #ifdef TEST_LOOPS
 
-extern cl_boolean test_loop_up (const uintD* ptr, uintC count);
+extern bool test_loop_up (const uintD* ptr, uintC count);
 
-extern cl_boolean test_loop_down (const uintD* ptr, uintC count);
+extern bool test_loop_down (const uintD* ptr, uintC count);
 
 #endif
 
@@ -169,7 +169,7 @@ extern void not_loop_up (uintD* xptr, uintC count);
 
 #ifdef TEST_LOOPS
 
-extern cl_boolean and_test_loop_up (const uintD* xptr, const uintD* yptr, uintC count);
+extern bool and_test_loop_up (const uintD* xptr, const uintD* yptr, uintC count);
 
 extern cl_signean compare_loop_up (const uintD* xptr, const uintD* yptr, uintC count);
 
@@ -259,7 +259,7 @@ extern void not_loop_down (uintD* xptr, uintC count);
 
 #ifdef TEST_LOOPS
 
-extern cl_boolean and_test_loop_down (const uintD* xptr, const uintD* yptr, uintC count);
+extern bool and_test_loop_down (const uintD* xptr, const uintD* yptr, uintC count);
 
 extern cl_signean compare_loop_down (const uintD* xptr, const uintD* yptr, uintC count);
 
@@ -628,18 +628,18 @@ inline uintD divucopy_loop_down (uintD digit, const uintD* sourceptr, uintD* des
 // test_loop_up(ptr,count)
 // testet count (uintC>=0) Digits aufwärts ab ptr, ob darunter eines /=0 ist.
 // Ergebnis /=0, falls ja.
-  inline cl_boolean test_loop_up (const uintD* ptr, uintC count)
-    { dotimesC(count,count, { if (*ptr++) return cl_true; } );
-      return cl_false;
+  inline bool test_loop_up (const uintD* ptr, uintC count)
+    { dotimesC(count,count, { if (*ptr++) return true; } );
+      return false;
     }
 
 // Test-Schleife:
 // test_loop_down(ptr,count)
 // testet count (uintC>=0) Digits abwärts ab ptr, ob darunter eines /=0 ist.
 // Ergebnis /=0, falls ja.
-  inline cl_boolean test_loop_down (const uintD* ptr, uintC count)
-    { dotimesC(count,count, { if (*--ptr) return cl_true; } );
-      return cl_false;
+  inline bool test_loop_down (const uintD* ptr, uintC count)
+    { dotimesC(count,count, { if (*--ptr) return true; } );
+      return false;
     }
 
 #endif
@@ -730,10 +730,10 @@ inline uintD divucopy_loop_down (uintD digit, const uintD* sourceptr, uintD* des
 // AND-Test-Schleife:
 // and_test_loop_up(xptr,yptr,count);
 // verknüpft count (uintC>=0) Digits aufwärts ab xptr und ab yptr durch AND
-// und testet, ob sich dabei ein Digit /=0 ergibt. Ergebnis cl_true, falls ja.
-  inline cl_boolean and_test_loop_up (const uintD* xptr, const uintD* yptr, uintC count)
-    { dotimesC(count,count, { if (*xptr++ & *yptr++) return cl_true; } );
-      return cl_false;
+// und testet, ob sich dabei ein Digit /=0 ergibt. Ergebnis true, falls ja.
+  inline bool and_test_loop_up (const uintD* xptr, const uintD* yptr, uintC count)
+    { dotimesC(count,count, { if (*xptr++ & *yptr++) return true; } );
+      return false;
     }
 
 // Vergleichsschleife:
@@ -1444,10 +1444,10 @@ inline uintD divucopy_loop_down (uintD digit, const uintD* sourceptr, uintD* des
 // AND-Test-Schleife:
 // and_test_loop_down(xptr,yptr,count);
 // verknüpft count (uintC>=0) Digits abwärts ab xptr und ab yptr durch AND
-// und testet, ob sich dabei ein Digit /=0 ergibt. Ergebnis cl_true, falls ja.
-  inline cl_boolean and_test_loop_down (const uintD* xptr, const uintD* yptr, uintC count)
-    { dotimesC(count,count, { if (*--xptr & *--yptr) return cl_true; } );
-      return cl_false;
+// und testet, ob sich dabei ein Digit /=0 ergibt. Ergebnis true, falls ja.
+  inline bool and_test_loop_down (const uintD* xptr, const uintD* yptr, uintC count)
+    { dotimesC(count,count, { if (*--xptr & *--yptr) return true; } );
+      return false;
     }
 
 // Vergleichsschleife:
@@ -2661,7 +2661,7 @@ extern void cl_UDS_mul_square (const uintD* sourceptr, uintC len,
 // UDS_sqrt(a_MSDptr,a_len,a_LSDptr, &b, squarep=)
 // > a_MSDptr/a_len/a_LSDptr: eine UDS
 // < NUDS b: Gaußklammer der Wurzel aus a
-// < squarep: cl_true falls a = b^2, cl_false falls b^2 < a < (b+1)^2.
+// < squarep: true falls a = b^2, false falls b^2 < a < (b+1)^2.
 // a wird nicht modifiziert.
 // Vorzeichenerweiterung von b ist erlaubt.
 // num_stack wird erniedrigt.
@@ -2671,7 +2671,7 @@ extern void cl_UDS_mul_square (const uintD* sourceptr, uintC len,
       num_stack_alloc_1(ceiling(_a_len,2),(b_)->MSDptr=,);             \
       squarep_zuweisung cl_UDS_sqrt(a_MSDptr,_a_len,a_LSDptr,b_);      \
     }
-  extern cl_boolean cl_UDS_sqrt (const uintD* a_MSDptr, uintC a_len, const uintD* a_LSDptr, DS* b_);
+  extern bool cl_UDS_sqrt (const uintD* a_MSDptr, uintC a_len, const uintD* a_LSDptr, DS* b_);
 
 
 // Auxiliary function for approximately computing 1/x
index 9de5fe1db0da0a35605f5aa5617b60140a786ed8..a64519faafd97acfda035fa4081aeda58b82e4ea 100644 (file)
@@ -58,14 +58,14 @@ namespace cln {
 // Break-even-point, should be acceptable for both architectures.
 // When in doubt, prefer to choose the standard algorithm.
 #if CL_USE_GMP
-  static inline cl_boolean cl_recip_suitable (uintL m, uintL n) // m > n
+  static inline bool cl_recip_suitable (uintL m, uintL n) // m > n
     { if (n < 900)
-        return cl_false;
+        return false;
       else
         if (n < 2200)
-          return (cl_boolean)((m >= n+50) && (m < 2*n-600));
+          return (m >= n+50) && (m < 2*n-600);
         else
-          return (cl_boolean)(m >= n+30);
+          return m >= n+30;
     }
 #else
 // Use the old default values from CLN version <= 1.0.3 as a crude estimate.
@@ -95,14 +95,14 @@ namespace cln {
 //   n = 2000: Newton faster for m >= 2020
 //   n = 2500: Newton faster for m >= 2520
 //   n = 5000: Newton faster for m >= 5020
-  static inline cl_boolean cl_recip_suitable (uintL m, uintL n) // m > n
+  static inline bool cl_recip_suitable (uintL m, uintL n) // m > n
     { if (n < 500)
-        return cl_false;
+        return false;
       else
         if (n < 1000)
-          return (cl_boolean)((m >= n+30) && (m < 3*n-600));
+          return (m >= n+30) && (m < 3*n-600);
         else
-          return (cl_boolean)(m >= n+20);
+          return m >= n+20;
     }
 #endif
 
index 76be717f417f849d9118f76efefa61bb37ba19c9..314e4cb7dd2d002e10970bfd12c585f63226a87a 100644 (file)
@@ -354,23 +354,23 @@ 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 (uintC len1, uintC len2)
+  static inline bool cl_fftm_suitable (uintC len1, uintC len2)
     { if (len1 >= cl_fftm_threshold)
-        return cl_true;
+        return true;
       if (len1 > cl_fftm_threshold1)
         if (len2 > cl_fftm_threshold2)
           { const unsigned int prod_threshold = cl_fftm_threshold*(cl_fftm_threshold-cl_fftm_threshold1);
             if (len1-cl_fftm_threshold1 >= prod_threshold)
-              return cl_true;
+              return true;
             if (len2-cl_fftm_threshold1 >= prod_threshold)
-              return cl_true;
+              return true;
             var uint32 hi;
             var uint32 lo;
             mulu32(len1-cl_fftm_threshold1,len2-cl_fftm_threshold1, hi=,lo=);
             if (hi > 0 || lo >= prod_threshold)
-              return cl_true;
+              return true;
           }
-      return cl_false;
+      return false;
     }
     
 #if 0 // Doesn't seem to be worth the effort
index 27704d4e5a92df819f06f185bafee422d7230a57..8531b5b1256cba0a43d89d377659105e36df8062 100644 (file)
@@ -44,7 +44,7 @@
       if (sourceptr1 == sourceptr2)
         if (len1 == len2)
           { mulu_karatsuba_square(sourceptr1,len1,destptr); return; }
-      var cl_boolean first_part = cl_true; // Flag, ob jetzt das erste Teilprodukt berechnet wird
+      var bool first_part = true; // Flag, ob jetzt das erste Teilprodukt berechnet wird
       if (len2 >= 2*len1)
         { CL_SMALL_ALLOCA_STACK;
           // Teilprodukte von jeweils len1 mal len1 Digits bilden:
                  if (first_part)
                    { copy_loop_lsp(prod_LSDptr,destptr,2*len1);
                      destptr = destptr lspop len1;
-                     first_part = cl_false;
+                     first_part = false;
                    }
                    else
                    { var uintD carry =
index d3afef7ba81b01e0e178f62087e2973400cb16a7..9b0f99c75d49c9ea5d4ee9ffe27583dc779bff5c 100644 (file)
@@ -29,8 +29,8 @@ 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 (uintC n)
-  { return (cl_boolean)(n >= 3200); }
+  static inline bool cl_recipsqrt_suitable (uintC n)
+  { return n >= 3200; }
 #else
 // Use the old default values from CLN version <= 1.0.3 as a crude estimate.
 // Time for square root of a_len = 2*N by b_len = N digits,
@@ -47,8 +47,8 @@ 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 (uintC n)
-  { return (cl_boolean)(n >= 2100); }
+  static inline bool cl_recipsqrt_suitable (uintC n)
+  { return n >= 2100; }
 #endif
 
 // Bildet zu einer Unsigned Digit sequence a die Wurzel
@@ -56,7 +56,7 @@ namespace cln {
 // squarep = cl_UDS_sqrt(a_MSDptr,a_len,a_LSDptr, &b);
 // > a_MSDptr/a_len/a_LSDptr: eine UDS
 // < NUDS b: Gaußklammer der Wurzel aus a
-// < squarep: cl_true falls a = b^2, cl_false falls b^2 < a < (b+1)^2.
+// < squarep: true falls a = b^2, false falls b^2 < a < (b+1)^2.
 // Methode:
 // erst A normalisieren. A=0 --> B=0, fertig.
 // Wähle n so, daß beta^(2n-2) <= A < beta^(2n).
@@ -102,12 +102,12 @@ namespace cln {
 //     Ergebnis ist [b[n-1],...,b[0]] * 2^(-s), schiebe also im Speicher
 //       [b[n],...,b[0]] um s+1 Bits nach rechts.
 //     Das Ergebnis ist eine NUDS der Länge n.
-cl_boolean cl_UDS_sqrt (const uintD* a_MSDptr, uintC a_len, const uintD* a_LSDptr, DS* b_)
+bool cl_UDS_sqrt (const uintD* a_MSDptr, uintC a_len, const uintD* a_LSDptr, DS* b_)
 {
       // A normalisieren:
       while ((a_len>0) && (mspref(a_MSDptr,0)==0)) { msshrink(a_MSDptr); a_len--; }
       if (a_len==0) // A=0 -> B := NUDS 0
-        { b_->LSDptr = b_->MSDptr; b_->len = 0; return cl_true; }
+        { b_->LSDptr = b_->MSDptr; b_->len = 0; return true; }
       CL_ALLOCA_STACK;
       // n und s bestimmen:
       var uintC n = ceiling(a_len,2); // a_len = 2n oder 2n-1, n>0.
@@ -195,9 +195,9 @@ cl_boolean cl_UDS_sqrt (const uintD* a_MSDptr, uintC a_len, const uintD* a_LSDpt
             shiftright_loop_msp(b_->MSDptr,n,s);
           // Teste, ob alle a[n],...,a[0]=0 sind:
           if (test_loop_msp(a_MSDptr mspop (n-1),n+1))
-            return cl_false;
+            return false;
           else
-            return cl_true; // ja -> Wurzel exakt
+            return true; // ja -> Wurzel exakt
         }
       // Platz für B belegen:
       { var uintD* b_MSDptr = b_->MSDptr mspop -1; // ab hier n+1 Digits Platz
@@ -354,9 +354,9 @@ cl_boolean cl_UDS_sqrt (const uintD* a_MSDptr, uintC a_len, const uintD* a_LSDpt
         b_->MSDptr = b_MSDptr; b_->len = n; b_->LSDptr = b_ptr;
         // Teste, ob alle a[n],...,a[0]=0 sind:
         if (test_loop_msp(a_mptr,n+1))
-          { return cl_false; }
+          { return false; }
           else
-          { return cl_true; } // ja -> Wurzel exakt
+          { return true; } // ja -> Wurzel exakt
       }}
 }
 // Bit complexity (N := a_len): O(M(N)).
index 92576f308ce7e840d4910a811ed3cf2ece29f9b3..92fbe8be334cfa4593ca367cd97e1fe30aa87df2 100644 (file)
@@ -33,7 +33,7 @@ protected:
     long * _slots;  // vector of length _modulus
     htxentry * _entries; // vector of length _size
     void* _total_vector;
-    cl_boolean (*_garcol_fun) (cl_heap*); // Function to make room in the table.
+    bool (*_garcol_fun) (cl_heap*); // Function to make room in the table.
                                // Putting some intelligent function here turns
                                // a normal hash table into a "weak" hash table.
 public:
@@ -144,7 +144,7 @@ protected:
     }
 private:
     // Default function to make room in a hash table.
-    static cl_boolean no_garcol (cl_heap* ht) { unused ht; return cl_false; }
+    static bool no_garcol (cl_heap* ht) { unused ht; return false; }
 };
 
 template <class htentry>
index 071cf85f8356cbaf89868df96a2a26ab8949935d..5766dd9cda75c409ac162c73e0293840c3c1b586 100644 (file)
@@ -27,9 +27,9 @@ struct cl_heap_weak_hashtable_1 : public cl_heap_hashtable_1 <key1_type,value_ty
        void operator delete (void* ptr) { free_hook(ptr); }
 public:
        // Function which tells when an unused entry may be garbage collected.
-       cl_boolean (* const _maygc_htentry) (const cl_htentry1<key1_type,value_type>&);
+       bool (* const _maygc_htentry) (const cl_htentry1<key1_type,value_type>&);
        // Constructor.
-       cl_heap_weak_hashtable_1 (cl_boolean (*maygc_htentry) (const cl_htentry1<key1_type,value_type>&))
+       cl_heap_weak_hashtable_1 (bool (*maygc_htentry) (const cl_htentry1<key1_type,value_type>&))
                : cl_heap_hashtable_1 <key1_type,value_type> (),
                  _maygc_htentry (maygc_htentry)
        {
@@ -39,14 +39,14 @@ private:
        // Garbage collection.
        // Before growing the table, we check whether we can remove unused
        // entries.
-       static cl_boolean garcol (cl_heap* _ht)
+       static bool garcol (cl_heap* _ht)
        {
                var cl_heap_weak_hashtable_1* ht = (cl_heap_weak_hashtable_1*)_ht;
                // Now ht->_garcol_fun = garcol.
                // It is not worth doing a garbage collection if the table
                // is small, say, has fewer than 100 entries.
                if (ht->_count < 100)
-                       return cl_false;
+                       return false;
                // Do a garbage collection.
                var long removed = 0;
                for (long i = 0; i < ht->_size; i++)
@@ -71,24 +71,24 @@ private:
                    }
                if (removed == 0)
                        // Unsuccessful. Let the table grow immediately.
-                       return cl_false;
+                       return false;
                else if (2*removed < ht->_count) {
                        // Table shrank by less than a factor of 1/1.5.
                        // Don't expand the table now, but expand it next time.
                        ht->_garcol_fun = cl_heap_weak_hashtable_1<key1_type,value_type>::garcol_nexttime;
-                       return cl_true;
+                       return true;
                } else {
                        // Table shrank much. Don't expand the table now,
                        // and try a GC next time.
-                       return cl_true;
+                       return true;
                }
        }
-       static cl_boolean garcol_nexttime (cl_heap* _ht)
+       static bool garcol_nexttime (cl_heap* _ht)
        {
                var cl_heap_weak_hashtable_1* ht = (cl_heap_weak_hashtable_1*)_ht;
                // Now ht->_garcol_fun = garcol_nexttime.
                ht->_garcol_fun = cl_heap_weak_hashtable_1<key1_type,value_type>::garcol;
-               return cl_false;
+               return false;
        }
 };
 
index f14d58570c22c1bade4962308756b53119477bd0..5a2db4515516491287e3e7182dd19df250c387ae 100644 (file)
@@ -27,9 +27,9 @@ struct cl_heap_weak_hashtable_2 : public cl_heap_hashtable_2 <key1_type,key2_typ
        void operator delete (void* ptr) { free_hook(ptr); }
 public:
        // Function which tells when an unused entry may be garbage collected.
-       cl_boolean (* const _maygc_htentry) (const cl_htentry2<key1_type,key2_type,value_type>&);
+       bool (* const _maygc_htentry) (const cl_htentry2<key1_type,key2_type,value_type>&);
        // Constructor.
-       cl_heap_weak_hashtable_2 (cl_boolean (*maygc_htentry) (const cl_htentry2<key1_type,key2_type,value_type>&))
+       cl_heap_weak_hashtable_2 (bool (*maygc_htentry) (const cl_htentry2<key1_type,key2_type,value_type>&))
                : cl_heap_hashtable_2 <key1_type,key2_type,value_type> (),
                  _maygc_htentry (maygc_htentry)
        {
@@ -39,14 +39,14 @@ private:
        // Garbage collection.
        // Before growing the table, we check whether we can remove unused
        // entries.
-       static cl_boolean garcol (cl_heap* _ht)
+       static bool garcol (cl_heap* _ht)
        {
                var cl_heap_weak_hashtable_2* ht = (cl_heap_weak_hashtable_2*)_ht;
                // Now ht->_garcol_fun = garcol.
                // It is not worth doing a garbage collection if the table
                // is small, say, has fewer than 100 entries.
                if (ht->_count < 100)
-                       return cl_false;
+                       return false;
                // Do a garbage collection.
                var long removed = 0;
                for (long i = 0; i < ht->_size; i++)
@@ -71,24 +71,24 @@ private:
                    }
                if (removed == 0)
                        // Unsuccessful. Let the table grow immediately.
-                       return cl_false;
+                       return false;
                else if (2*removed < ht->_count) {
                        // Table shrank by less than a factor of 1/1.5.
                        // Don't expand the table now, but expand it next time.
                        ht->_garcol_fun = garcol_nexttime;
-                       return cl_true;
+                       return true;
                } else {
                        // Table shrank much. Don't expand the table now,
                        // and try a GC next time.
-                       return cl_true;
+                       return true;
                }
        }
-       static cl_boolean garcol_nexttime (cl_heap* _ht)
+       static bool garcol_nexttime (cl_heap* _ht)
        {
                var cl_heap_weak_hashtable_2* ht = (cl_heap_weak_hashtable_2*)_ht;
                // Now ht->_garcol_fun = garcol_nexttime.
                ht->_garcol_fun = cl_heap_weak_hashtable_2<key1_type,key2_type,value_type>::garcol;
-               return cl_false;
+               return false;
        }
 };
 
index fd1793fded700bdca0e61d2d601675c50ce2eb4e..79d6cc48163dabf3716586650988ba9273e10f23 100644 (file)
@@ -38,14 +38,14 @@ private:
        // Garbage collection.
        // Before growing the table, we check whether we can remove unused
        // entries.
-       static cl_boolean garcol (cl_heap* _ht)
+       static bool garcol (cl_heap* _ht)
        {
                var cl_heap_weak_hashtable_uniq* ht = (cl_heap_weak_hashtable_uniq*)_ht;
                // Now ht->_garcol_fun = garcol.
                // It is not worth doing a garbage collection if the table
                // is small, say, has fewer than 100 entries.
                if (ht->_count < 100)
-                       return cl_false;
+                       return false;
                // Do a garbage collection.
                var long removed = 0;
                for (long i = 0; i < ht->_size; i++)
@@ -71,24 +71,24 @@ private:
                    }
                if (removed == 0)
                        // Unsuccessful. Let the table grow immediately.
-                       return cl_false;
+                       return false;
                else if (2*removed < ht->_count) {
                        // Table shrank by less than a factor of 1/1.5.
                        // Don't expand the table now, but expand it next time.
                        ht->_garcol_fun = garcol_nexttime;
-                       return cl_true;
+                       return true;
                } else {
                        // Table shrank much. Don't expand the table now,
                        // and try a GC next time.
-                       return cl_true;
+                       return true;
                }
        }
-       static cl_boolean garcol_nexttime (cl_heap* _ht)
+       static bool garcol_nexttime (cl_heap* _ht)
        {
                var cl_heap_weak_hashtable_uniq* ht = (cl_heap_weak_hashtable_uniq*)_ht;
                // Now ht->_garcol_fun = garcol_nexttime.
                ht->_garcol_fun = garcol;
-               return cl_false;
+               return false;
        }
 };
 
index cd3ef247c1410b648a3f415d919d6a6fd5aeb855..392cd4faab1355f3d881b1443d8434099a79e085 100644 (file)
@@ -29,7 +29,7 @@ cl_class cl_class_weak_hashtable_from_rcpointer2_to_rcpointer = {
 
 // These are not inline, because they tend to duplicate a lot of template code.
 
-cl_wht_from_rcpointer2_to_rcpointer::cl_wht_from_rcpointer2_to_rcpointer (cl_boolean (*maygc_htentry) (const cl_htentry_from_rcpointer2_to_rcpointer&))
+cl_wht_from_rcpointer2_to_rcpointer::cl_wht_from_rcpointer2_to_rcpointer (bool (*maygc_htentry) (const cl_htentry_from_rcpointer2_to_rcpointer&))
 {
        var cl_heap_weak_hashtable_from_rcpointer2_to_rcpointer* ht = new cl_heap_weak_hashtable_from_rcpointer2_to_rcpointer (maygc_htentry);
        ht->refcount = 1;
index 434dae549aa6b548b9aecbf809ef7f6865e93f46..3fcd0c16738d5aa833b364de80df3e48e13265bf 100644 (file)
@@ -30,7 +30,7 @@ typedef _cl_hashtable_iterator<cl_htentry_from_rcpointer2_to_rcpointer> cl_hasht
 
 struct cl_wht_from_rcpointer2_to_rcpointer : public cl_rcpointer {
        // Constructors.
-       cl_wht_from_rcpointer2_to_rcpointer (cl_boolean (*maygc_htentry) (const cl_htentry_from_rcpointer2_to_rcpointer&));
+       cl_wht_from_rcpointer2_to_rcpointer (bool (*maygc_htentry) (const cl_htentry_from_rcpointer2_to_rcpointer&));
        cl_wht_from_rcpointer2_to_rcpointer (const cl_wht_from_rcpointer2_to_rcpointer&);
        // Assignment operators.
        cl_wht_from_rcpointer2_to_rcpointer& operator= (const cl_wht_from_rcpointer2_to_rcpointer&);
index 6d134a5f5a64f93cef8c09e4459e7758575f5588..c711d7edca1856c7ac80500ffad461ed1ea98b20 100644 (file)
@@ -29,7 +29,7 @@ cl_class cl_class_weak_hashtable_from_rcpointer_to_rcpointer = {
 
 // These are not inline, because they tend to duplicate a lot of template code.
 
-cl_wht_from_rcpointer_to_rcpointer::cl_wht_from_rcpointer_to_rcpointer (cl_boolean (*maygc_htentry) (const cl_htentry_from_rcpointer_to_rcpointer&))
+cl_wht_from_rcpointer_to_rcpointer::cl_wht_from_rcpointer_to_rcpointer (bool (*maygc_htentry) (const cl_htentry_from_rcpointer_to_rcpointer&))
 {
        var cl_heap_weak_hashtable_from_rcpointer_to_rcpointer* ht = new cl_heap_weak_hashtable_from_rcpointer_to_rcpointer (maygc_htentry);
        ht->refcount = 1;
index cda04e8bba3299468fcdd3bfb952a39c9009feca..661630701cdaf285f5e12ced8782e88e99d52c0b 100644 (file)
@@ -25,7 +25,7 @@ typedef _cl_hashtable_iterator<cl_htentry_from_rcpointer_to_rcpointer> cl_hashta
 
 struct cl_wht_from_rcpointer_to_rcpointer : public cl_rcpointer {
        // Constructors.
-       cl_wht_from_rcpointer_to_rcpointer (cl_boolean (*maygc_htentry) (const cl_htentry_from_rcpointer_to_rcpointer&));
+       cl_wht_from_rcpointer_to_rcpointer (bool (*maygc_htentry) (const cl_htentry_from_rcpointer_to_rcpointer&));
        cl_wht_from_rcpointer_to_rcpointer (const cl_wht_from_rcpointer_to_rcpointer&);
        // Assignment operators.
        cl_wht_from_rcpointer_to_rcpointer& operator= (const cl_wht_from_rcpointer_to_rcpointer&);
index fcfea5f31b2fe3f856dfe48731cc1db164fa5468..543c865d93ea8ba9a7fac71da54f71707743b0ef 100644 (file)
@@ -18,10 +18,10 @@ cl_print_flags default_print_flags;
 AT_INITIALIZATION(default_print_flags)
 {
        default_print_flags.rational_base = 10;
-       default_print_flags.rational_readably = cl_false;
-       default_print_flags.float_readably = cl_false;
+       default_print_flags.rational_readably = false;
+       default_print_flags.float_readably = false;
        default_print_flags.default_float_format = float_format_ffloat;
-       default_print_flags.complex_readably = cl_false;
+       default_print_flags.complex_readably = false;
        default_print_flags.vector_syntax = vsyntax_pretty;
        default_print_flags.univpoly_varname = "x";
 }
index 6c4f7a004af392c8354a0e396b2d095f9d4dfddf..59048646fd8f7a11e6d13c4e337c0c6e01420483 100644 (file)
@@ -79,14 +79,14 @@ static void dummy_fprint (cl_heap_ring* R, std::ostream& stream, const _cl_ring_
        unused stream;
        throw uninitialized_exception(x);
 }
-static cl_boolean dummy_equal (cl_heap_ring* R, const _cl_ring_element& x, const _cl_ring_element& y)
+static bool dummy_equal (cl_heap_ring* R, const _cl_ring_element& x, const _cl_ring_element& y)
 {
        unused R;
        throw uninitialized_exception(x, y);
 }
 
 #define dummy_zero dummy_op0
-static cl_boolean dummy_zerop (cl_heap_ring* R, const _cl_ring_element& x)
+static bool dummy_zerop (cl_heap_ring* R, const _cl_ring_element& x)
 {
        unused R;
        throw uninitialized_exception(x);
index 8e96f142fe2a0433c8dd1b48d7189f7e3e7c8a2b..4089808b3173a2f9e5a9d26e8e7fcfc5e21306d0 100644 (file)
@@ -48,28 +48,28 @@ inline cl_N::cl_N (cl_heap_complex* ptr)
 #endif
 
 // Type tests
-inline cl_boolean realp (const cl_N& x)
+inline bool realp (const cl_N& x)
 {
        if (x.pointer_p())
                if (x.heappointer->type == &cl_class_complex)
-                       return cl_false;
-       return cl_true;
+                       return false;
+       return true;
 }
-inline cl_boolean complexp (const cl_N& x)
+inline bool complexp (const cl_N& x)
 {
        if (x.pointer_p())
                if (x.heappointer->type == &cl_class_complex)
-                       return cl_true;
-       return cl_false;
+                       return true;
+       return false;
 }
 
 // Comparison with a fixnum.
-inline cl_boolean eq (const cl_N& x, sint32 y)
+inline bool eq (const cl_N& x, sint32 y)
 {
-       return (cl_boolean)(x.word == cl_combine(cl_FN_tag,y));
+       return x.word == cl_combine(cl_FN_tag,y);
 }
 
-inline cl_boolean exact_zerop (const cl_N& x)
+inline bool exact_zerop (const cl_N& x)
 {
        return eq(x,0);
 }
@@ -82,10 +82,10 @@ class cl_C : public cl_N {
 public:
 };
 
-inline cl_boolean realp (const cl_C& x)
-       { unused x; return cl_false; }
-inline cl_boolean complexp (const cl_C& x)
-       { unused x; return cl_true; }
+inline bool realp (const cl_C& x)
+       { unused x; return false; }
+inline bool complexp (const cl_C& x)
+       { unused x; return true; }
 
 
 // Liefert zu reellen Zahlen a und b /= Fixnum 0 die komplexe Zahl a+bi.
index b02810637c14c9a087ab7e1c7302d0f5f6be606d..813b8c45db151239176f9c2ac659102162ce862b 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace cln {
 
-cl_boolean equal (const cl_N& x, const cl_N& y)
+bool equal (const cl_N& x, const cl_N& y)
 {
 // Methode:
 // Falls beide reell, klar.
@@ -31,7 +31,7 @@ cl_boolean equal (const cl_N& x, const cl_N& y)
                        DeclareType(cl_C,y);
                        // x reell, y komplex
                        if (!zerop(imagpart(y)))
-                               return cl_false;
+                               return false;
                        return equal(x,realpart(y));
                }
        } else {
@@ -40,16 +40,16 @@ cl_boolean equal (const cl_N& x, const cl_N& y)
                        DeclareType(cl_R,y);
                        // x komplex, y reell
                        if (!zerop(imagpart(x)))
-                               return cl_false;
+                               return false;
                        return equal(realpart(x),y);
                } else {
                        DeclareType(cl_C,y);
                        // x,y beide komplex
                        if (!equal(realpart(x),realpart(y)))
-                               return cl_false;
+                               return false;
                        if (!equal(imagpart(x),imagpart(y)))
-                               return cl_false;
-                       return cl_true;
+                               return false;
+                       return true;
                }
        }
 }
index 50450d1e8ea3674768831e3a86ec6f2b92fd6d7f..3dd6c7c4a397145b78079f035647f7a081dfc344 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace cln {
 
-cl_boolean zerop (const cl_N& x)
+bool zerop (const cl_N& x)
 {
        if (realp(x)) {
                DeclareType(cl_R,x);
@@ -26,8 +26,8 @@ cl_boolean zerop (const cl_N& x)
                var const cl_R& b = imagpart(x);
                if (zerop(a))
                        if (zerop(b))
-                               return cl_true;
-               return cl_false;
+                               return true;
+               return false;
        }
 }
 
index 8b9de6fda006f18a01019cbce3c900810b4384c3..32fee76d9a621a96291c71033cb6ea3977fbb744 100644 (file)
@@ -18,7 +18,7 @@ cl_read_flags cl_N_read_flags = {
        syntax_number,
        lsyntax_all,
        10,
-       { float_format_ffloat, float_format_lfloat_min, cl_true }
+       { float_format_ffloat, float_format_lfloat_min, true }
 };
 
 cl_N::cl_N (const char * string)
index 76fabe2637b99f79c5d51d91cd85ba9ebfed21f3..cc9a043589a807a009a57c7072089ff69361a194 100644 (file)
@@ -164,29 +164,29 @@ not_rational_syntax:
                }
                var const char * ptr_after_sign = ptr;
                var const char * ptr_after_intpart = skip_digits(ptr_after_sign,string_limit,float_base);
-               var cl_boolean have_dot = cl_false;
+               var bool have_dot = false;
                var const char * ptr_before_fracpart = ptr_after_intpart;
                var const char * ptr_after_fracpart = ptr_after_intpart;
                ptr = ptr_after_intpart;
                if (ptr != string_limit)
                  if (*ptr == '.') {
-                       have_dot = cl_true;
+                       have_dot = true;
                        ptr_before_fracpart = ptr+1;
                        ptr_after_fracpart = skip_digits(ptr_before_fracpart,string_limit,float_base);
                }
                ptr = ptr_after_fracpart;
                var char exponent_marker;
-               var cl_boolean have_exponent;
+               var bool have_exponent;
                var const char * ptr_in_exponent = ptr;
                var const char * ptr_after_exponent = ptr;
                if ((ptr == string_limit) || !(((*ptr >= '0') && (*ptr <= '9')) || ((*ptr >= 'A') && (*ptr <= 'Z') && (*ptr != 'I')) || ((*ptr >= 'a') && (*ptr <= 'z') && (*ptr != 'i')) || (*ptr == '.') || (*ptr == '/'))) {
                        // No exponent.
-                       have_exponent = cl_false;
+                       have_exponent = false;
                        // Must have at least one fractional part digit.
                        if (ptr_after_fracpart == ptr_before_fracpart) goto not_float_syntax;
                        exponent_marker = 'E';
                } else {
-                       have_exponent = cl_true;
+                       have_exponent = true;
                        // Must have at least one digit.
                        if (ptr_after_sign == ptr_after_intpart)
                                if (ptr_after_fracpart == ptr_before_fracpart)
index 3f119c4147c7a248d57b061e7694d595a7b4792c..330f068eb3a5eeb5151f666274a1cc7d4347f629 100644 (file)
@@ -24,17 +24,17 @@ public:
        char* end_pointer (void) { return buffer+index; }
 };
 
-static cl_boolean number_char_p (char c)
+static bool number_char_p (char c)
 {
        if ((c >= '0') && (c <= '9'))
-               return cl_true;
+               return true;
        if (((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z')))
-               return cl_true;
+               return true;
        switch (c) {
                case '+': case '-': case '.': case '_': case '/':
-                       return cl_true;
+                       return true;
                default:
-                       return cl_false;
+                       return false;
        }
 }
 
index 64e1da03095cb463a099b894dc2d77626c5f61b8..1143deaca941f16b220c3e291e50a428c5b79954 100644 (file)
@@ -49,7 +49,7 @@ const cl_N expt (const cl_N& x, const cl_I& y)
                return expt(x,y);
        }
        if (eq(y,0)) { return 1; } // y=0 -> Ergebnis 1
-       var cl_boolean y_negative = minusp(y);
+       var bool y_negative = minusp(y);
        var cl_I abs_y = (y_negative ? -y : y); // Betrag von y nehmen
        var cl_N z = expt_pos(x,abs_y); // (expt x (abs y))
        return (y_negative ? recip(z) : z); // evtl. noch Kehrwert nehmen
index 15cccfd67042de8b3c53909d5698c7106092c6ed..003b6c3ae492ed69b21193f21856cdaf1b94d5cf 100644 (file)
@@ -16,9 +16,9 @@ namespace cln {
 
 // Cf. cl_N_p in cl_C_ring.cc.
 // But here, for better inlining in g++, it is preferrable to finish every
-// alternative with either "return cl_true;" or "return cl_false;".
+// alternative with either "return true;" or "return false;".
 
-inline cl_boolean cl_N_p (const cl_number& x)
+inline bool cl_N_p (const cl_number& x)
 {
        if (!x.pointer_p())
                switch (x.nonpointer_tag()) {
@@ -27,12 +27,12 @@ inline cl_boolean cl_N_p (const cl_number& x)
                #if defined(CL_WIDE_POINTERS)
                case cl_FF_tag:
                #endif
-                       return cl_true;
+                       return true;
                }
        else
                if (x.pointer_type()->flags & cl_class_flags_subclass_complex)
-                       return cl_true;
-       return cl_false;
+                       return true;
+       return false;
 }
 
 const cl_N& cl_N_As (const cl_number& x, const char * filename, int line)
index 5a576ece813e2ac2e24be81b05d0c1b9ed4fb6f3..296971aaa327c64e34af28a6aae503723cb5f400 100644 (file)
@@ -23,7 +23,7 @@ static void N_fprint (cl_heap_ring* R, std::ostream& stream, const _cl_ring_elem
        fprint(stream,The(cl_N)(x));
 }
 
-static cl_boolean N_equal (cl_heap_ring* R, const _cl_ring_element& x, const _cl_ring_element& y)
+static bool N_equal (cl_heap_ring* R, const _cl_ring_element& x, const _cl_ring_element& y)
 {
        unused R;
        return equal(The(cl_N)(x),The(cl_N)(y));
@@ -34,7 +34,7 @@ static const _cl_ring_element N_zero (cl_heap_ring* R)
        return _cl_ring_element(R, (cl_N)0);
 }
 
-static cl_boolean N_zerop (cl_heap_ring* R, const _cl_ring_element& x)
+static bool N_zerop (cl_heap_ring* R, const _cl_ring_element& x)
 {
        unused R;
        // Here we return true only if x is the *exact* zero. Because we
@@ -84,12 +84,10 @@ static const _cl_ring_element N_expt_pos (cl_heap_ring* R, const _cl_ring_elemen
        return _cl_ring_element(R, expt(The(cl_N)(x),y));
 }
 
-static cl_boolean cl_N_p (const cl_number& x)
+static bool cl_N_p (const cl_number& x)
 {
-       return (cl_boolean)
-              (!x.pointer_p()
-               || (x.pointer_type()->flags & cl_class_flags_subclass_complex) != 0
-              );
+       return (!x.pointer_p()
+               || (x.pointer_type()->flags & cl_class_flags_subclass_complex) != 0);
 }
 
 static cl_ring_setops N_setops = {
index 5e042c920e098030e59114b5c0b9f87e62272888..16d6d833ef45a0c2845a7e96051f6576d7365f6c 100644 (file)
@@ -152,7 +152,7 @@ const cl_N expt (const cl_N& x, const cl_N& y)
                                if (rationalp(realpart(x)) && rationalp(imagpart(x)))
                                        goto complex_rational;
                        }
-                       if (cl_false) {
+                       if (false) {
                                complex_rational:
                                // x in Q(i)
                                var uintC k = power2p(n);
index 573d525909d9b3a3fd4c6541911821aea1827596..a7c5678615d5d85f57d9266ebe1b44f80ef4db66 100644 (file)
@@ -11,7 +11,7 @@
 
 namespace cln {
 
-cl_boolean cl_inhibit_floating_point_underflow = cl_false;
+bool cl_inhibit_floating_point_underflow = false;
 
 float_format_t default_float_format      = float_format_ffloat;
 
index a62329ddf1df9022cf63af78f8151ed7042b6969..900b01fff3d7a1c666879222893aab3bd7b2b86e 100644 (file)
@@ -75,12 +75,12 @@ extern cl_class cl_class_dfloat;
 extern cl_class cl_class_lfloat;
 
 // Type test.
-inline cl_boolean longfloatp (const cl_F& x)
+inline bool longfloatp (const cl_F& x)
 {
        if (x.pointer_p())
                if (x.pointer_type() == &cl_class_lfloat)
-                       return cl_true;
-       return cl_false;
+                       return true;
+       return false;
 }
 
 // Macro: verteilt je nach Float-Typ eines Floats x auf 4 Statements.
index 201e2e3edb0b449a3905ae786e7a7fd32632723c..42af650afedb41a15898369f11f80165028cda41 100644 (file)
@@ -59,7 +59,7 @@ const cl_DF sqrt (const cl_DF& x)
       #endif
       {CL_ALLOCA_STACK;
        var DS wurzel;
-       var cl_boolean exactp;
+       var bool exactp;
        UDS_sqrt(arrayMSDptr(mant,128/intDsize),128/intDsize,arrayLSDptr(mant,128/intDsize), &wurzel, exactp=);
        // wurzel = isqrt(2^74_75 * mant), eine 64-Bit-Zahl.
        mantx = get_64_Dptr(wurzel.MSDptr);
@@ -117,7 +117,7 @@ const cl_DF sqrt (const cl_DF& x)
       #endif
       {CL_ALLOCA_STACK;
        var DS wurzel;
-       var cl_boolean exactp;
+       var bool exactp;
        UDS_sqrt(arrayMSDptr(mant,128/intDsize),128/intDsize,arrayLSDptr(mant,128/intDsize), &wurzel, exactp=);
        // wurzel = isqrt(2^74_75 * mant), eine 64-Bit-Zahl.
        {var uintD* ptr = wurzel.MSDptr;
index 8cb841e3897795149b4b122bdb428cd5900f23b7..285e1892b2ef79c870edbd557931b8d2af2c5444 100644 (file)
@@ -26,7 +26,7 @@ double double_approx (const cl_I& x)
       // NDS zu |x|>0 bilden:
       var const uintD* MSDptr;
       var uintC len;
-      I_to_NDS_nocopy(abs_x, MSDptr=,len=,,cl_false,);
+      I_to_NDS_nocopy(abs_x, MSDptr=,len=,,false,);
       // MSDptr/len/LSDptr ist die NDS zu x, len>0.
       // Führende Digits holen: Brauche DF_mant_len+1 Bits, dazu intDsize
       // Bits (die NDS kann mit bis zu intDsize Nullbits anfangen).
index d07225b68e789e8a46944577491f4050710644e4..e07071a577267dd411ce5c88c63620cf1215d07c 100644 (file)
@@ -38,7 +38,7 @@ const cl_DF cl_I_to_DF (const cl_I& x)
       // NDS zu |x|>0 bilden:
       var const uintD* MSDptr;
       var uintC len;
-      I_to_NDS_nocopy(abs_x, MSDptr=,len=,,cl_false,);
+      I_to_NDS_nocopy(abs_x, MSDptr=,len=,,false,);
       // MSDptr/len/LSDptr ist die NDS zu x, len>0.
       // Führende Digits holen: Brauche DF_mant_len+1 Bits, dazu intDsize
       // Bits (die NDS kann mit bis zu intDsize Nullbits anfangen).
index e708a8ea24b1258a11b0a4ebfba945bc7e41f274..77f4ffa82484796ab7ba6663049b32e2a7d9a8ff 100644 (file)
 namespace cln {
 
 MAYBE_INLINE
-cl_boolean minusp (const cl_DF& x)
+bool minusp (const cl_DF& x)
 {
 #if (cl_word_size==64)
-       return (cl_boolean) ((sint64)TheDfloat(x)->dfloat_value_semhi < 0);
+       return (sint64)TheDfloat(x)->dfloat_value_semhi < 0;
 #else
-       return (cl_boolean) ((sint32)TheDfloat(x)->dfloat_value_semhi < 0);
+       return (sint32)TheDfloat(x)->dfloat_value_semhi < 0;
 #endif
 }
 
index e67b497edff9a3d0df57a01f134fd884673e7517..78238aca0d0b721484285a077a3fd89d6cf7a44a 100644 (file)
 namespace cln {
 
 MAYBE_INLINE2
-cl_boolean plusp (const cl_DF& x)
+bool plusp (const cl_DF& x)
 {
        if (minusp(x))
-               return cl_false; // x<0 -> nein
+               return false; // x<0 -> nein
        elif (zerop(x))
-               return cl_false; // x=0 -> nein
+               return false; // x=0 -> nein
        else
-               return cl_true; // sonst ist x>0.
+               return true; // sonst ist x>0.
 }
 
 }  // namespace cln
index 7f72d81dcb35b2e74688dc920fcf8b5194461873..37bf62ab3f88d4e868ee90284e77acd006380579 100644 (file)
 namespace cln {
 
 MAYBE_INLINE
-cl_boolean zerop (const cl_DF& x)
+bool zerop (const cl_DF& x)
 {
 #if 0
-       return (cl_boolean) (DF_uexp(TheDfloat(x)->dfloat_value_semhi) == 0);
+       return DF_uexp(TheDfloat(x)->dfloat_value_semhi) == 0;
 #else // this is faster
-       return (cl_boolean) (TheDfloat(x)->dfloat_value_semhi == 0);
+       return TheDfloat(x)->dfloat_value_semhi == 0;
 #endif
 }
 
index 973a8c3289d125cb7d2e0e0b0cbbe592a966b8d9..c1069d2482224d9a09d89a0f4388e2f349784703 100644 (file)
@@ -19,7 +19,7 @@ cl_read_flags cl_DF_read_flags = {
        syntax_dfloat,
        lsyntax_all,
        10,
-       { float_format_dfloat, float_format_lfloat_min, cl_false }
+       { float_format_dfloat, float_format_lfloat_min, false }
 };
 
 cl_DF::cl_DF (const char * string)
index f37817082cc3a39a77a22c417b47b3e1cc470deb..ac091e9937af851f5a8c0843986a6d9fc97fd21f 100644 (file)
 
 namespace cln {
 
-inline cl_boolean cl_DF_p (const cl_number& x)
+inline bool cl_DF_p (const cl_number& x)
 {
        if (x.pointer_p())
                if (x.heappointer->type == &cl_class_dfloat)
-                       return cl_true;
-       return cl_false;
+                       return true;
+       return false;
 }
 
 const cl_DF& cl_DF_As (const cl_number& x, const char * filename, int line)
index e2bba66180a4848c94161691cc5c2bf0b29c8f78..09b0cb780110e2b63380351214863246cd1a806c 100644 (file)
@@ -20,7 +20,7 @@
 
 namespace cln {
 
-cl_boolean minusp (const cl_F& x)
+bool minusp (const cl_F& x)
 {
        floatcase(x
        ,       return minusp(x);
index 229164fbd3d1e19038622fd9a985311984460ab9..d76d2a5a96088fd43565f88849e165d5b9cecf4d 100644 (file)
@@ -20,7 +20,7 @@
 
 namespace cln {
 
-cl_boolean plusp (const cl_F& x)
+bool plusp (const cl_F& x)
 {
        floatcase(x
        ,       return plusp(x);
index 3126d467e37fafda4a1f914ce2df3a2c8d54bd64..1cf5e22fb0c778f8bdb767df543e7668453c101c 100644 (file)
@@ -20,7 +20,7 @@
 
 namespace cln {
 
-cl_boolean zerop (const cl_F& x)
+bool zerop (const cl_F& x)
 {
        floatcase(x
        ,       return zerop(x);
index 8b0b56e35c976549ffc107b2b201114c3b87ab8b..043c1188b1f274bc638a9827356507b578da96e6 100644 (file)
@@ -26,7 +26,7 @@ float float_approx (const cl_I& x)
       // NDS zu |x|>0 bilden:
       var const uintD* MSDptr;
       var uintC len;
-      I_to_NDS_nocopy(abs_x, MSDptr=,len=,,cl_false,);
+      I_to_NDS_nocopy(abs_x, MSDptr=,len=,,false,);
       // MSDptr/len/LSDptr ist die NDS zu x, len>0.
       // Führende Digits holen: Brauche FF_mant_len+1 Bits, dazu intDsize
       // Bits (die NDS kann mit bis zu intDsize Nullbits anfangen).
index edf5e456e4c804ab948420119b212addf6ac9052..9e44d16bc42adf6b270512f4568c33a43f1faaaa 100644 (file)
@@ -38,7 +38,7 @@ const cl_FF cl_I_to_FF (const cl_I& x)
       // NDS zu |x|>0 bilden:
       var const uintD* MSDptr;
       var uintC len;
-      I_to_NDS_nocopy(abs_x, MSDptr=,len=,,cl_false,);
+      I_to_NDS_nocopy(abs_x, MSDptr=,len=,,false,);
       // MSDptr/len/LSDptr ist die NDS zu x, len>0.
       // Führende Digits holen: Brauche FF_mant_len+1 Bits, dazu intDsize
       // Bits (die NDS kann mit bis zu intDsize Nullbits anfangen).
index 666b97f7c29dbaaa839a898e16f5cad1a81d1e33..2f34de29d8efa6aa7cd1d7aedd2566c3f6bf1b79 100644 (file)
@@ -14,9 +14,9 @@
 namespace cln {
 
 MAYBE_INLINE
-cl_boolean minusp (const cl_FF& x)
+bool minusp (const cl_FF& x)
 {
-       return (cl_boolean) ((sint32)cl_ffloat_value(x) < 0);
+       return (sint32)cl_ffloat_value(x) < 0;
 }
 
 }  // namespace cln
index 93aa87bbeb7a9cb558f7d67e55197f7917db5119..46d6a4972e8162095d292cdb4c11b23d3adb9536 100644 (file)
 namespace cln {
 
 MAYBE_INLINE2
-cl_boolean plusp (const cl_FF& x)
+bool plusp (const cl_FF& x)
 {
        if (minusp(x))
-               return cl_false; // x<0 -> nein
+               return false; // x<0 -> nein
        elif (zerop(x))
-               return cl_false; // x=0 -> nein
+               return false; // x=0 -> nein
        else
-               return cl_true; // sonst ist x>0.
+               return true; // sonst ist x>0.
 }
 
 }  // namespace cln
index bec6869c995772ac1f21aac0ff3a2f6904015a3c..1e64d07044ec5ed4c260af3b605a5b965c59854e 100644 (file)
@@ -14,9 +14,9 @@
 namespace cln {
 
 MAYBE_INLINE
-cl_boolean zerop (const cl_FF& x)
+bool zerop (const cl_FF& x)
 {
-       return (cl_boolean) (cl_ffloat_value(x) == 0);
+       return cl_ffloat_value(x) == 0;
 }
 
 }  // namespace cln
index e842af8a06e5fc6f7279fe5a842b20a6a7e77b70..8fd62a415e16d90b49ac2e3f09caab8c555177d4 100644 (file)
@@ -19,7 +19,7 @@ cl_read_flags cl_FF_read_flags = {
        syntax_ffloat,
        lsyntax_all,
        10,
-       { float_format_ffloat, float_format_lfloat_min, cl_false }
+       { float_format_ffloat, float_format_lfloat_min, false }
 };
 
 cl_FF::cl_FF (const char * string)
index e9bbfef73ab588313fd64c1d1e8814ad782e3580..fac89fe6f305817b1062554508b2ae82c44591a2 100644 (file)
 
 namespace cln {
 
-inline cl_boolean cl_FF_p (const cl_number& x)
+inline bool cl_FF_p (const cl_number& x)
 {
 #if defined(CL_WIDE_POINTERS)
        if (!x.pointer_p())
                if (cl_tag((x).word) == cl_FF_tag)
-                       return cl_true;
+                       return true;
 #else
        if (x.pointer_p())
                if (x.heappointer->type == &cl_class_ffloat)
-                       return cl_true;
+                       return true;
 #endif
-       return cl_false;
+       return false;
 }
 
 const cl_FF& cl_FF_As (const cl_number& x, const char * filename, int line)
index ad07636241574ec56a2e2b8085f9d9b23dbe12ba..f58be3cf9c825cf0c06626b92df193c564187f6d 100644 (file)
@@ -19,7 +19,7 @@ cl_read_flags cl_F_read_flags = {
        syntax_float,
        lsyntax_all,
        10,
-       { float_format_ffloat, float_format_lfloat_min, cl_true }
+       { float_format_ffloat, float_format_lfloat_min, true }
 };
 
 cl_F::cl_F (const char * string)
index 52b3e2b100d0cd05d017628dda53f0dbcead0038..6856d8ca7d69036ce8635e5a1184a4acb27bf44b 100644 (file)
@@ -75,29 +75,29 @@ const cl_F read_float (const cl_read_flags& flags, const char * string, const ch
                }
                var const char * ptr_after_sign = ptr;
                var const char * ptr_after_intpart = skip_digits(ptr_after_sign,string_limit,float_base);
-               var cl_boolean have_dot = cl_false;
+               var bool have_dot = false;
                var const char * ptr_before_fracpart = ptr_after_intpart;
                var const char * ptr_after_fracpart = ptr_after_intpart;
                ptr = ptr_after_intpart;
                if (ptr != string_limit)
                  if (*ptr == '.') {
-                       have_dot = cl_true;
+                       have_dot = true;
                        ptr_before_fracpart = ptr+1;
                        ptr_after_fracpart = skip_digits(ptr_before_fracpart,string_limit,float_base);
                }
                ptr = ptr_after_fracpart;
                var char exponent_marker;
-               var cl_boolean have_exponent;
+               var bool have_exponent;
                var const char * ptr_in_exponent = ptr;
                var const char * ptr_after_exponent = ptr;
                if ((ptr == string_limit) || !(((*ptr >= '0') && (*ptr <= '9')) || ((*ptr >= 'A') && (*ptr <= 'Z') && (*ptr != 'I')) || ((*ptr >= 'a') && (*ptr <= 'z') && (*ptr != 'i')) || (*ptr == '.') || (*ptr == '/'))) {
                        // No exponent.
-                       have_exponent = cl_false;
+                       have_exponent = false;
                        // Must have at least one fractional part digit.
                        if (ptr_after_fracpart == ptr_before_fracpart) goto not_float_syntax;
                        exponent_marker = 'E';
                } else {
-                       have_exponent = cl_true;
+                       have_exponent = true;
                        // Must have at least one digit.
                        if (ptr_after_sign == ptr_after_intpart)
                                if (ptr_after_fracpart == ptr_before_fracpart)
index d7a4eefe754157cb94746050b2fefd19264f05d8..83fafeafeefb30652baed38d539933fe713e160a 100644 (file)
@@ -26,17 +26,17 @@ public:
        char* end_pointer (void) { return buffer+index; }
 };
 
-static cl_boolean number_char_p (char c)
+static bool number_char_p (char c)
 {
        if ((c >= '0') && (c <= '9'))
-               return cl_true;
+               return true;
        if (((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z')))
-               return cl_true;
+               return true;
        switch (c) {
                case '+': case '-': case '.': case '_': case '/':
-                       return cl_true;
+                       return true;
                default:
-                       return cl_false;
+                       return false;
        }
 }
 
index ae0719429cdc31a3e5fe0849353ebfe9c479cd8a..1acb1badaa4143f6db48aa83ce84ced91bf53ca0 100644 (file)
@@ -107,7 +107,7 @@ const cl_LF sqrt (const cl_LF& x)
         }
 #endif
       var DS w;
-      var cl_boolean exactp;
+      var bool exactp;
       UDS_sqrt(r_MSDptr,r_len,r_LSDptr, &w, exactp=);
       // w ist die Ganzzahl-Wurzel, eine n+1-Digit-Zahl.
       copy_loop_msp(w.MSDptr,y_mantMSDptr,len); // NUDS nach y kopieren
index 8f3772f7da3dc9db98dff7ff12e752323d9516e6..fbfa52c72a03f96a233699b1be043b469f9b5c5c 100644 (file)
@@ -44,7 +44,7 @@ const cl_LF cl_LF_I_div (const cl_LF& x, const cl_I& y)
        var const uintD* y_MSDptr;
        var uintC y_len;
        var const uintD* y_LSDptr;
-       I_to_NDS_nocopy(abs_y, y_MSDptr=,y_len=,y_LSDptr=,cl_false,); // NDS zu y bilden, y_len>0
+       I_to_NDS_nocopy(abs_y, y_MSDptr=,y_len=,y_LSDptr=,false,); // NDS zu y bilden, y_len>0
        // y nicht zu einer NUDS normalisieren! (Damit ein Bit Spielraum ist.)
        // Zähler bilden: x * 2^(intDsize*y_len)
        var uintD* z_MSDptr;
index ebcf481e2fb9ddff5717f58747a40f418a5c5b1e..f6992a06116f73a1c16ad7428908503dfbd20671 100644 (file)
@@ -39,7 +39,7 @@ const cl_R cl_LF_I_mul (const cl_LF& x, const cl_I& y)
        var const uintD* y_MSDptr;
        var uintC y_len;
        var const uintD* y_LSDptr;
-       I_to_NDS_nocopy(abs_y, y_MSDptr=,y_len=,y_LSDptr=,cl_false,); // NDS zu y bilden, y_len>0
+       I_to_NDS_nocopy(abs_y, y_MSDptr=,y_len=,y_LSDptr=,false,); // NDS zu y bilden, y_len>0
        if (mspref(y_MSDptr,0)==0) y_len--; // NUDS zu y bilden, y_len>0
        // Multiplizieren.
        var uintD* prodMSDptr;
index 9601436e6e506354056649124254b1f352ebd6c4..4d919c40a72021a552d2fe09c8142ad310838d13 100644 (file)
@@ -49,7 +49,7 @@ const cl_LF cl_I_to_LF (const cl_I& x, uintC len)
       var uintD* y_mantMSDptr = arrayMSDptr(TheLfloat(y)->data,len);
       var const uintD* x_MSDptr;
       var uintC x_len;
-      I_to_NDS_nocopy(abs_x, x_MSDptr=,x_len=,,cl_false,); // NDS zu x bilden, x_len>0
+      I_to_NDS_nocopy(abs_x, x_MSDptr=,x_len=,,false,); // NDS zu x bilden, x_len>0
       // x_MSDptr/x_len/.. um (exp mod 16) Bits nach rechts shiften und in
       // y einfüllen (genauer: nur maximal len Digits davon):
       {var uintL shiftcount = exp % intDsize;
index 882bd77da8e0953884ae84a794f485bd9faf6ea6..55df5046bcb9c1217c1e60806e78b30fe5af720c 100644 (file)
@@ -14,9 +14,9 @@
 namespace cln {
 
 MAYBE_INLINE
-cl_boolean minusp (const cl_LF& x)
+bool minusp (const cl_LF& x)
 {
-       return (cl_boolean) (- TheLfloat(x)->sign);
+       return -TheLfloat(x)->sign;
 }
 
 }  // namespace cln
index 24df977c1ccc2799768e6e956fd851347926b0a6..6c029713db2549f13436d9a2d9f3b4cfdf1ace84 100644 (file)
 namespace cln {
 
 MAYBE_INLINE2
-cl_boolean plusp (const cl_LF& x)
+bool plusp (const cl_LF& x)
 {
        if (minusp(x))
-               return cl_false; // x<0 -> nein
+               return false; // x<0 -> nein
        elif (zerop(x))
-               return cl_false; // x=0 -> nein
+               return false; // x=0 -> nein
        else
-               return cl_true; // sonst ist x>0.
+               return true; // sonst ist x>0.
 }
 
 }  // namespace cln
index bbfbb0eac2ae2b19725dd411da7a91db07a0c504..35135c498673a35972b73b885e621c45506e22f1 100644 (file)
@@ -14,9 +14,9 @@
 namespace cln {
 
 MAYBE_INLINE
-cl_boolean zerop (const cl_LF& x)
+bool zerop (const cl_LF& x)
 {
-       return (cl_boolean) (TheLfloat(x)->expo == 0);
+       return TheLfloat(x)->expo == 0;
 }
 
 }  // namespace cln
index 591119e03dbbf6a1b82a689917f52cd9774d15fa..107020f92303653b6205402570a5b1ffa4f2a1e9 100644 (file)
@@ -19,7 +19,7 @@ cl_read_flags cl_LF_read_flags = {
        syntax_lfloat,
        lsyntax_all,
        10,
-       { float_format_lfloat_min, float_format_lfloat_min, cl_false }
+       { float_format_lfloat_min, float_format_lfloat_min, false }
 };
 
 cl_LF::cl_LF (const char * string)
index ef6f527b6ec8401b5d123e3300b6793210d2d83e..47312db99f7b9754d9777d9aeb37f62bd457d247 100644 (file)
 
 namespace cln {
 
-inline cl_boolean cl_LF_p (const cl_number& x)
+inline bool cl_LF_p (const cl_number& x)
 {
        if (x.pointer_p())
                if (x.heappointer->type == &cl_class_lfloat)
-                       return cl_true;
-       return cl_false;
+                       return true;
+       return false;
 }
 
 const cl_LF& cl_LF_As (const cl_number& x, const char * filename, int line)
index cd122dc22c222332931e50cd434ca6f2c7f27050..4677bb492b4db346b0ed43167ff040a5eac192ef 100644 (file)
@@ -13,7 +13,7 @@
 
 namespace cln {
 
-inline cl_boolean cl_F_p (const cl_number& x)
+inline bool cl_F_p (const cl_number& x)
 {
        if (!x.pointer_p())
                switch (cl_tag((x).word)) {
@@ -21,12 +21,12 @@ inline cl_boolean cl_F_p (const cl_number& x)
                #if defined(CL_WIDE_POINTERS)
                case cl_FF_tag:
                #endif
-                       return cl_true;
+                       return true;
                }
        else
                if (x.heappointer->type->flags & cl_class_flags_subclass_float)
-                       return cl_true;
-       return cl_false;
+                       return true;
+       return false;
 }
 
 const cl_F& cl_F_As (const cl_number& x, const char * filename, int line)
index 9f871a0863aa2d3025974265cdce9c21febe1166..602872c058132fe5bbd12c8ae88d1d9d9f8be9c1 100644 (file)
@@ -335,14 +335,14 @@ static const cl_decimal_decoded_float decode_float_decimal (const cl_F& x)
   //    wird er gewählt, die anderen vergessen.
   // 3. Sonst wird unter allen noch möglichen Werten der zu x
   //    nächstgelegene gewählt.
-  var cl_boolean d_shift = cl_false; // Flag, ob im 1. Schritt d incrementiert wurde
+  var bool d_shift = false; // Flag, ob im 1. Schritt d incrementiert wurde
   var cl_I a; // das ausgewählte a
   // 1.
   {
     var cl_I b1 = ceiling1(a1,10);
     var cl_I b2 = floor1(a2,10);
     if (b1 <= b2) // noch eine durch 10 teilbare Zahl a ?
-      { a1 = b1; a2 = b2; d = d+1; d_shift = cl_true; }
+      { a1 = b1; a2 = b2; d = d+1; d_shift = true; }
       else
       goto keine_10_mehr;
   }
index e3f0029e1e618ff6f2fc8b72ac0ae9822671b350..21f337b31079e08eca77811858514cf7cde46109 100644 (file)
@@ -37,7 +37,7 @@ const cl_SF cl_I_to_SF (const cl_I& x)
       // NDS zu |x|>0 bilden:
       var const uintD* MSDptr;
       var uintC len;
-      I_to_NDS_nocopy(abs_x, MSDptr=,len=,,cl_false,);
+      I_to_NDS_nocopy(abs_x, MSDptr=,len=,,false,);
       // MSDptr/len/LSDptr ist die NDS zu x, len>0.
       // Führende Digits holen: Brauche SF_mant_len+1 Bits, dazu intDsize
       // Bits (die NDS kann mit bis zu intDsize Nullbits anfangen).
index 6e631591b97d433e1bd24eb8a8f6e7effa835151..b9d2932c607386361d43c896edc6f9fdd69d1766 100644 (file)
@@ -14,9 +14,9 @@
 namespace cln {
 
 MAYBE_INLINE
-cl_boolean minusp (const cl_SF& x)
+bool minusp (const cl_SF& x)
 {
-       return (cl_boolean) ((x.word & bit(SF_sign_shift)) != 0);
+       return (x.word & bit(SF_sign_shift)) != 0;
 }
 
 }  // namespace cln
index abc59e07064332ed6ecbc2f6e9ee49171d495c32..45e67983a2b4a11f682dbc5609c0fc4d95c273e2 100644 (file)
 namespace cln {
 
 MAYBE_INLINE2
-cl_boolean plusp (const cl_SF& x)
+bool plusp (const cl_SF& x)
 {
        if (minusp(x))
-               return cl_false; // x<0 -> nein
+               return false; // x<0 -> nein
        elif (zerop(x))
-               return cl_false; // x=0 -> nein
+               return false; // x=0 -> nein
        else
-               return cl_true; // sonst ist x>0.
+               return true; // sonst ist x>0.
 }
 
 }  // namespace cln
index 9404d0a47e573357ea58207cab0d93e711def343..93634584b3765234e7dba70d3e34ea628ac9f694 100644 (file)
@@ -14,9 +14,9 @@
 namespace cln {
 
 MAYBE_INLINE
-cl_boolean zerop (const cl_SF& x)
+bool zerop (const cl_SF& x)
 {
-       return (cl_boolean) (x.word == make_SF_word(0,0,0));
+       return x.word == make_SF_word(0,0,0);
 }
 
 }  // namespace cln
index 063708ee96280fda9c2dddc66647d8e16f2484cc..e223b4c0deec289356cf5e4c2f15d8818fb0c015 100644 (file)
@@ -19,7 +19,7 @@ cl_read_flags cl_SF_read_flags = {
        syntax_sfloat,
        lsyntax_all,
        10,
-       { float_format_sfloat, float_format_lfloat_min, cl_false }
+       { float_format_sfloat, float_format_lfloat_min, false }
 };
 
 cl_SF::cl_SF (const char * string)
index d5a32ffc139f46e4e5ea116ef4b72ec68d39e75c..2976ddba9570c4ee351740c43370d9457627011b 100644 (file)
 
 namespace cln {
 
-inline cl_boolean cl_SF_p (const cl_number& x)
+inline bool cl_SF_p (const cl_number& x)
 {
        if (!x.pointer_p())
                if (cl_tag((x).word) == cl_SF_tag)
-                       return cl_true;
-       return cl_false;
+                       return true;
+       return false;
 }
 
 const cl_SF& cl_SF_As (const cl_number& x, const char * filename, int line)
index 38fd1098cdbb3a692166f4b238bf4d0bd09f06dc..ee511308ca415e6b9d9e653d01826698e9ae9266 100644 (file)
@@ -198,7 +198,7 @@ static const cl_LF atanx_ratseries (const cl_LF& t)
                var uintE me = cl_I_to_UE(- y_.exponent);
                var cl_I p;
                var uintE lq;
-               var cl_boolean last_step = cl_false;
+               var bool last_step = false;
                if (lm >= me) { // |y| >= 1/2 ?
                        p = y_.sign; // 1 or -1
                        lq = 1;
@@ -219,7 +219,7 @@ static const cl_LF atanx_ratseries (const cl_LF& t)
                        // after the next big multiplication. This saves one
                        // big multiplication at the end.
                        if (2*n >= lm)
-                               last_step = cl_true;
+                               last_step = true;
                }
                z = z + scale_float(cl_I_to_LF(p,len),-(sintE)lq);
                if (last_step)
index 3f3dfec786edf3a63305cd5159653fa50ce2f697..a42effde310bcfdec779ffa197b5332bbb07b5a0 100644 (file)
@@ -151,7 +151,7 @@ const cl_LF expx_ratseries (const cl_LF& x)
        //  (b) 311 317 305 312 295 291 286 293 291 284 295 284 293 287 288 305
        // (a): N=300, time in 0.01 sec. (b): N=1000, time in 0.1 sec.
        // Values 2.5 <= c <= 3.2 seem best. Let's choose c = 2.875.
-       var cl_boolean first_factor = cl_true;
+       var bool first_factor = true;
        var cl_LF product;
        var uintE b1;
        var uintE b2;
@@ -166,7 +166,7 @@ const cl_LF expx_ratseries (const cl_LF& x)
                        var cl_LF factor = cl_exp_aux(pk,lqk,len);
                        if (first_factor) {
                                product = factor;
-                               first_factor = cl_false;
+                               first_factor = false;
                        } else
                                product = product * factor;
                }
index b00a5d1965010d664da56f5a18e91dec0a86d2f0..d09b8dae75d0a1a2864c12ac33148d92348e8451 100644 (file)
@@ -204,7 +204,7 @@ const cl_LF lnx_ratseries (const cl_LF& x)
                var uintE me = cl_I_to_UE(- x1_.exponent);
                var cl_I p;
                var uintE lq;
-               var cl_boolean last_step = cl_false;
+               var bool last_step = false;
                if (lm >= me) { // |x'| >= 1/2 ?
                        p = x1_.sign; // 1 or -1
                        lq = 1;
@@ -225,7 +225,7 @@ const cl_LF lnx_ratseries (const cl_LF& x)
                        // after the next big multiplication. This saves one
                        // big multiplication at the end.
                        if (2*n >= lm)
-                               last_step = cl_true;
+                               last_step = true;
                }
                y = y + scale_float(cl_I_to_LF(p,len),-(sintE)lq);
                if (last_step)
index 7a926b7a40ebead9896c24d539b648dd969a0c40..9d8c4891f1b554b1308b3a425f36b3e22744693a 100644 (file)
@@ -29,7 +29,7 @@ const cl_LF_cosh_sinh_t cl_coshsinh_ratseries (const cl_LF& x)
        var uintE lq = cl_I_to_UE(- x_.exponent);
        var const cl_I& p = x_.mantissa;
        // Compute sinh(p/2^lq) and cosh(p/2^lq) by splitting into pieces.
-       var cl_boolean first_factor = cl_true;
+       var bool first_factor = true;
        var cl_LF_cosh_sinh_t product;
        var uintE b1;
        var uintE b2;
@@ -44,7 +44,7 @@ const cl_LF_cosh_sinh_t cl_coshsinh_ratseries (const cl_LF& x)
                        var cl_LF_cosh_sinh_t factor = cl_coshsinh_aux(pk,lqk,len);
                        if (first_factor) {
                                product = factor;
-                               first_factor = cl_false;
+                               first_factor = false;
                        } else
                                product = product * factor;
                }
index 15d5a817691d376d5e2e2d666f6de8301f1c7cff..2c4244c88ce1d98d343f3bbcca64855f04e5c132 100644 (file)
@@ -29,7 +29,7 @@ const cl_LF_cos_sin_t cl_cossin_ratseries (const cl_LF& x)
        var uintE lq = cl_I_to_UE(- x_.exponent);
        var const cl_I& p = x_.mantissa;
        // Compute sin(p/2^lq) and cos(p/2^lq) by splitting into pieces.
-       var cl_boolean first_factor = cl_true;
+       var bool first_factor = true;
        var cl_LF_cos_sin_t product;
        var uintE b1;
        var uintE b2;
@@ -44,7 +44,7 @@ const cl_LF_cos_sin_t cl_cossin_ratseries (const cl_LF& x)
                        var cl_LF_cos_sin_t factor = cl_cossin_aux(pk,lqk,len);
                        if (first_factor) {
                                product = factor;
-                               first_factor = cl_false;
+                               first_factor = false;
                        } else
                                product = product * factor;
                }
index 0e023ac25ca0d369a05210de697450603c68355e..97cc535e6b6c4a924fb78b81ee126e51d0326989 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace cln {
 
-void eval_pqcd_series_aux (uintC 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, bool rightmost)
 {
        // N = N2-N1
        switch (N) {
@@ -60,7 +60,7 @@ void eval_pqcd_series_aux (uintC N, cl_pqcd_series_term* args, cl_pqcd_series_re
                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);
+               eval_pqcd_series_aux(Nm,args+0,L,false);
                // Compute right part.
                var cl_pqcd_series_result R;
                eval_pqcd_series_aux(N-Nm,args+Nm,R,rightmost);
index f6886bd15cbb504ba3325a6699cf026102acdc0e..3373fbcd338c8006a2274acc9229f2fc81dbdcd3 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace cln {
 
-void eval_pqd_series_aux (uintC 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, bool rightmost)
 {
        // N = N2-N1
        switch (N) {
@@ -56,7 +56,7 @@ void eval_pqd_series_aux (uintC N, cl_pqd_series_term* args, cl_pqd_series_resul
                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);
+               eval_pqd_series_aux(Nm,args+0,L,false);
                // Compute right part.
                var cl_pqd_series_result R;
                eval_pqd_series_aux(N-Nm,args+Nm,R,rightmost);
index 3dedf50caca8a4e7147ad4721b3e1e4a624de900..9a32a137c0fe954a4000d7ae5f46c4acd2fc0fc6 100644 (file)
@@ -227,7 +227,7 @@ struct cl_pqcd_series_result {
        cl_I D;
        cl_I V;
 };
-extern void eval_pqcd_series_aux (uintC 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, bool rightmost = true);
 // Ditto, but returns U/S.
 extern const cl_LF eval_pqcd_series (uintC N, cl_pqcd_series_term* args, uintC len);
 
@@ -255,7 +255,7 @@ struct cl_pqd_series_result {
        cl_I D;
        cl_I V;
 };
-extern void eval_pqd_series_aux (uintC 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, bool rightmost = true);
 // Ditto, but returns U/S.
 extern const cl_LF eval_pqd_series (uintC N, cl_pqd_series_term* args, uintC len);
 
index e3b2d68b62d0b3bc8ab6f42be2f8562fa2ef77a9..0286c04e98832ef00df83f9c0bb4e3bf4c9ea2b0 100644 (file)
@@ -19,12 +19,12 @@ namespace cln {
 // Falls n >= integer_length(x): NEIN. (Da y>=2, müßte x>=2^n gelten.)
 // Hier also n>0 klein...
 
-cl_boolean rootp (const cl_I& x, uintL n, cl_I* w)
+bool rootp (const cl_I& x, uintL 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
+         { *w = x; return true; } // ja -> x als Ergebnis
        if (n >= integer_length(x))
-         { return cl_false; }
+         { return false; }
        return cl_rootp_aux(x,n,w);
 }
 
index 678a314364d3f2131bb4fe6f55c9b22d6456a00f..88468deb98ac6ec6ba3c2895070d6d5e62e44f35 100644 (file)
@@ -19,12 +19,12 @@ namespace cln {
 // Falls n >= integer_length(x): NEIN. (Da y>=2, müßte x>=2^n gelten.)
 // Hier also n>0 klein...
 
-cl_boolean rootp (const cl_I& x, const cl_I& n, cl_I* w)
+bool 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
+         { *w = x; return true; } // ja -> x als Ergebnis
        if (n >= (cl_I)(unsigned long)integer_length(x))
-         { return cl_false; }
+         { return false; }
        // Nun ist n < (integer-length x). Also paßt n in ein uintC.
        return cl_rootp_aux(x,cl_I_to_ulong(n),w);
 }
index ad0a8900b0a1aab957d82c0b7d24491abd83b0d1..073c5c0271a71a79899ee508cc4aaf2bf80cc114 100644 (file)
@@ -22,9 +22,9 @@ namespace cln {
 // > n: ein Integer >0
 // > Annahme: x > 1 und n < (integer-length x).
 // < w: Integer (expt x (/ n)) falls x eine n-te Potenz
-// < ergebnis: cl_true         ........................, cl_false sonst
+// < ergebnis: true         ........................, false sonst
 
-cl_boolean cl_rootp_aux (cl_I x, uintL n, cl_I* w)
+bool cl_rootp_aux (cl_I x, uintL n, cl_I* w)
 {
 
 // Methode:
@@ -59,16 +59,16 @@ cl_boolean cl_rootp_aux (cl_I x, uintL n, cl_I* w)
 
       while ((n % 2) == 0) // n gerade?
         { if (!sqrtp(x,&x)) // Quadratwurzel ziehen versuchen
-            { return cl_false; } // nicht ganzzahlig -> fertig
+            { return false; } // nicht ganzzahlig -> fertig
           n = n >> 1; // n := (/ n 2)
         }
       // Nun ist n ungerade.
-      if (n==1) { *w = x; return cl_true; } // n=1 -> x als Ergebnis
+      if (n==1) { *w = x; return true; } // n=1 -> x als Ergebnis
       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
+          if (!(o_r==0)) { return false; } // o nicht durch n teilbar -> fertig
           // oq = o/n.
           // dividiere x durch 2^o:
           x = ash(x,-(sintC)o);
@@ -93,7 +93,7 @@ cl_boolean cl_rootp_aux (cl_I x, uintL n, cl_I* w)
        n_UDS_ok: ; // n_MSDptr/n_len/n_LSDptr ist NUDS zu n.
       }
       #endif
-      I_to_NDS_nocopy(x, ,x_len=,x_LSDptr=,cl_false,); // UDS zu x bilden, x_len>0
+      I_to_NDS_nocopy(x, ,x_len=,x_LSDptr=,false,); // UDS zu x bilden, x_len>0
       var uintD x_lsd = lspref(x_LSDptr,0); // letztes Digit von x
       var uintD y_lsd; // n-te Wurzel von x_lsd mod 2^intDsize
       y_lsd = 1; // Wurzel mod 2^1
@@ -185,7 +185,7 @@ cl_boolean cl_rootp_aux (cl_I x, uintL n, cl_I* w)
           // mit x vergleichen:
           if (!(x == c))
             // Die ganze Rechnung war umsonst.
-            { return cl_false; }
+            { return false; }
         }
         // y ist tatsächlich n-te Wurzel von x.
         // Noch mit 2^oq multiplizieren:
@@ -193,7 +193,7 @@ cl_boolean cl_rootp_aux (cl_I x, uintL n, cl_I* w)
           { *w = y; }
           else
           { *w = ash(y,oq); }
-        return cl_true;
+        return true;
       }
 }
 
index 44a5eb1b6a81a07f166daf828bbeb3a61fad9877..afec1692fdb56e0c07a7788e3d17b309ec442b20 100644 (file)
@@ -19,7 +19,7 @@
 
 namespace cln {
 
-cl_boolean isqrt (const cl_I& x, cl_I* w)
+bool isqrt (const cl_I& x, cl_I* w)
 {
        if (minusp(x)) {
                std::ostringstream buf;
@@ -31,9 +31,9 @@ cl_boolean isqrt (const cl_I& x, cl_I* w)
        var const uintD* x_MSDptr;
        var uintC x_len;
        var const uintD* x_LSDptr;
-       I_to_NDS_nocopy(x, x_MSDptr=,x_len=,x_LSDptr=,cl_true,); // Digit sequence >=0 zu x
+       I_to_NDS_nocopy(x, x_MSDptr=,x_len=,x_LSDptr=,true,); // Digit sequence >=0 zu x
        var DS y;
-       var cl_boolean squarep;
+       var bool squarep;
        UDS_sqrt(x_MSDptr,x_len,x_LSDptr, &y, squarep=); // Wurzel ziehen
        *w = NUDS_to_I(y.MSDptr,y.len); // als Integer
        return squarep;
index f1b03fff8133a0c0665f0a0d216e4e5a8a672e87..493424007a3b25b525319d3925f457bc51ad2f41 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace cln {
 
-cl_boolean sqrtp (const cl_I& x, cl_I* w)
+bool sqrtp (const cl_I& x, cl_I* w)
 {
 // Methode:
 // [Henri Cohen: A course in computational algebraic number theory, 2nd prnt.,
@@ -54,31 +54,31 @@ cl_boolean sqrtp (const cl_I& x, cl_I* w)
       var uintC x_len;
       var const uintD* x_LSDptr;
       I_to_NDS_nocopy(x, x_MSDptr=,x_len=,x_LSDptr=, // Digit sequence >=0 zu x
-                      cl_true, { *w = 0; return cl_true; } // 0 is a square
+                      true, { *w = 0; return true; } // 0 is a square
                      );
       // Check mod 64.
       { var uintD lsd = lspref(x_LSDptr,0);
         if (!squares_mod_64[lsd & 63])
-          { return cl_false; } // not a square mod 64 -> not a square
+          { return false; } // not a square mod 64 -> not a square
       }
       // Check mod 63.
       { var cl_I_div_t div63 = cl_divide(x,L_to_FN(63));
         if (!squares_mod_63[FN_to_UV(div63.remainder)])
-          { return cl_false; } // not a square mod 63 -> not a square
+          { return false; } // not a square mod 63 -> not a square
       }
       // Check mod 65.
       { var cl_I_div_t div65 = cl_divide(x,L_to_FN(65));
         if (!squares_mod_65[FN_to_UV(div65.remainder)])
-          { return cl_false; } // not a square mod 65 -> not a square
+          { return false; } // not a square mod 65 -> not a square
       }
       // Check mod 11.
       { var cl_I_div_t div11 = cl_divide(x,L_to_FN(11));
         if (!squares_mod_11[FN_to_UV(div11.remainder)])
-          { return cl_false; } // not a square mod 11 -> not a square
+          { return false; } // not a square mod 11 -> not a square
       }
       // Check with full precision.
       { var DS y;
-        var cl_boolean squarep;
+        var bool squarep;
         UDS_sqrt(x_MSDptr,x_len,x_LSDptr, &y, squarep=); // Wurzel ziehen
         if (squarep)
           { *w = NUDS_to_I(y.MSDptr,y.len); } // als Integer
index 19c9f1cdcae20c2aa3d7db68c860d2baad39bb8c..345de1c76c0e414a73b450acaab0d19ed9742c3d 100644 (file)
@@ -39,7 +39,7 @@ const cl_I ash (const cl_I& x, sintC y)
                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.
+               I_to_NDS_nocopy(x, ,len=,x_LSDptr=,false,); // DS zu x bilden.
                if (k >= (uintC)(~len)) // kann len+k+1 Überlauf geben?
                        { throw ash_exception(y); } // ja -> Fehler
                num_stack_alloc_1(len+k,,LSDptr=);
index cee74a33133f1767f94e4957d0904666d2e3cf7e..15ea72863dace5107da0e370f0bb08049c837223 100644 (file)
@@ -84,7 +84,7 @@ const cl_I ash (const cl_I& x, const cl_I& y)
                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.
+               I_to_NDS_nocopy(x, ,len=,x_LSDptr=,false,); // DS zu x bilden.
                if (k >= (uintC)(~len)) // kann len+k+1 Überlauf geben?
                        { throw ash_exception(y); } // ja -> Fehler
                num_stack_alloc_1(len+k,,LSDptr=);
index 6ef57d21a7ffd2bde9a8e6c8d41e2b17fd8fe57d..ca5ca3b9a4f8433a43b773f936d2492bbc6c03d8 100644 (file)
@@ -20,8 +20,8 @@ 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, uintC p, uintC q);
+// Ergebnis (wie bei LDB-TEST) false wenn nein, true wenn ja.
+extern bool 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).
index c902008e16a6f00f364ca57e992ede6ff1177e41..5b01c31fa1894527a32cf09ffce2f5f0bb588881 100644 (file)
@@ -15,7 +15,7 @@
 
 namespace cln {
 
-cl_boolean ldb_test (const cl_I& n, const cl_byte& b)
+bool ldb_test (const cl_I& n, const cl_byte& b)
 {
       // Methode:
       // (ldb-test (byte s p) n)
@@ -31,19 +31,19 @@ cl_boolean ldb_test (const cl_I& n, const cl_byte& b)
       //       extrahiere die Bits p,...,p+s-1 von n und teste sie.
       var uintC s = b.size;
       var uintC p = b.position;
-      if (s==0) return cl_false;
+      if (s==0) return false;
       var uintC l = integer_length(n); // l = (integer-length n)
       if (l<=p)
         // l<=p
         if (!minusp(n))
-          return cl_false; // n>=0
+          return false; // n>=0
           else
-          return cl_true; // n<0
+          return true; // n<0
         else
         // l>p
         { var uintC ps = p+s;
           if (ps>l) // p+s>l ?
-            return cl_true;
+            return true;
           // Bits p,...,q-1 mit q = min(p+s,l) = p+s extrahieren und testen:
           return ldb_extract_test(n,p,ps);
         }
index 2a015165dba915385a01df33414cb419b0d93811..603f7f6bfcfce344f7dd4b85260abd8e4401e973 100644 (file)
@@ -20,7 +20,7 @@ const cl_I ldb_extract (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 0; } ); // NDS zu x bilden
+      I_to_NDS_nocopy(x, MSDptr=,len=,LSDptr=,true, { return 0; } ); // NDS zu x bilden
       // MSDptr erhöhen und len erniedrigen, so daß len = ceiling(q/intDsize) wird:
       { var uintC qD = ceiling(q,intDsize); // ceiling(q/intDsize)
         // wegen q<=l ist qD = ceiling(q/intDsize) <= ceiling((l+1)/intDsize) = len, also
index d5447e7eb8c302865c5ceb121be7f9de531fa9ef..007a968bd37d3948877665d434052e7ca5cf26ae 100644 (file)
 
 namespace cln {
 
-cl_boolean ldb_extract_test (const cl_I& x, uintC p, uintC q)
+bool 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
+      I_to_NDS_nocopy(x, MSDptr=,len=,LSDptr=,true, { return false; } ); // NDS zu x bilden
       // MSDptr erhöhen und len erniedrigen, so daß len = ceiling(q/intDsize) wird:
       { var uintC qD = ceiling(q,intDsize); // ceiling(q/intDsize)
         // wegen q<=l ist qD = ceiling(q/intDsize) <= ceiling((l+1)/intDsize) = len, also
@@ -33,7 +33,7 @@ cl_boolean ldb_extract_test (const cl_I& x, uintC p, uintC q)
         len -= pD;
       }
       // Jetzt enthält MSDptr/len/LSDptr genau die maßgeblichen Digits.
-      if (len==0) return cl_false; // len=0 -> keine Bits abzutesten
+      if (len==0) return false; // len=0 -> keine Bits abzutesten
       q = ((q-1)%intDsize); // q := intDsize - (intDsize*ceiling(q/intDsize) - q) - 1
       p = p%intDsize; // p := p - intDsize*floor(p/intDsize)
       // Jetzt ist 0 <= q < intDsize, 0 <= p < intDsize.
@@ -45,16 +45,16 @@ cl_boolean ldb_extract_test (const cl_I& x, uintC p, uintC q)
         // 1 Digit maßgeblich, wird von beiden Seiten angeschnitten:
         // Ein AND 2^(q+1)-2^p erreicht dies.
         if (!(((uintD)(bitm(q+1)-bit(p)) & mspref(MSDptr,0)) == 0))
-          return cl_true;
+          return true;
           else
-          return cl_false;
+          return false;
       // mindestens 2 Digits. Teste erst die Randdigits, dann die inneren:
       if (!(((msprefnext(MSDptr) & (uintD)(bitm(q+1)-1)) == 0) &&
             ((lsprefnext(LSDptr) & (uintD)(minus_bit(p))) == 0)
          ) )
-        return cl_true;
+        return true;
       len--; // die beiden Randdigits sind jetzt abgezogen.
-      if (DS_test_loop(MSDptr,len,LSDptr)) { return cl_true; } else { return cl_false; }
+      if (DS_test_loop(MSDptr,len,LSDptr)) { return true; } else { return false; }
     }
 
 }  // namespace cln
index 8227b2e773bdd7d45c7ececd0c7c04f895eebf15..5a0c3b1a1c05e72c1afee9808129f988440bb093 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace cln {
 
-cl_boolean logbitp (uintC x, const cl_I& y)
+bool logbitp (uintC x, const cl_I& y)
 {
     // Methode:
     // Falls x>=intDsize*Länge(y), teste Vorzeichen von y.
@@ -23,19 +23,19 @@ cl_boolean logbitp (uintC x, const cl_I& y)
        var const uintD* yMSDptr;
        var uintC ylen;
        var const uintD* yLSDptr;
-       I_to_NDS_nocopy(y, yMSDptr=,ylen=,yLSDptr=,cl_true, { return cl_false; } ); // DS zu y
+       I_to_NDS_nocopy(y, yMSDptr=,ylen=,yLSDptr=,true, { return false; } ); // DS zu y
        if (x < intDsize*ylen)
                // x ist >=0, < intDsize*ylen
                { if (lspref(yLSDptr,floor(x,intDsize)) & bit(x%intDsize))
-                   return cl_true;
+                   return true;
                    else
-                   return cl_false;
+                   return false;
                }
        // Vorzeichen von y testen
        if (/* (ylen > 0) && */ ((sintD)mspref(yMSDptr,0) < 0))
-           return cl_true;
+           return true;
            else
-           return cl_false;
+           return false;
 }
 
 }  // namespace cln
index bb26201c607fc83a138f3aa21f9be1a2637b851a..03e885649d1b1d83b429cd6981098718fea222a8 100644 (file)
@@ -18,7 +18,7 @@
 
 namespace cln {
 
-cl_boolean logbitp (const cl_I& x, const cl_I& y)
+bool logbitp (const cl_I& x, const cl_I& y)
 {
     // Methode:
     // Falls x<0, Error.
@@ -29,19 +29,19 @@ cl_boolean logbitp (const cl_I& x, const cl_I& y)
             { var uintV x_ = FN_to_V(x);
               var uintC ylen;
               var const uintD* yLSDptr;
-              I_to_NDS_nocopy(y, ,ylen=,yLSDptr=,cl_true, { return cl_false; } ); // DS zu y
+              I_to_NDS_nocopy(y, ,ylen=,yLSDptr=,true, { return false; } ); // DS zu y
               if (x_ < intDsize*ylen)
                 // x ist ein Fixnum >=0, < intDsize*ylen
                 { if (lspref(yLSDptr,floor(x_,intDsize)) & bit(x_%intDsize))
-                    return cl_true;
+                    return true;
                     else
-                    return cl_false;
+                    return false;
             }   }
           // Vorzeichen von y testen
           if (minusp(y))
-            return cl_true;
+            return true;
             else
-            return cl_false;
+            return false;
         }
         else
         // x<0
index cb2d93773cb18d222a985d927a31db9566683a3e..5a2d0c17f2a303138839595874679285c54f8b24 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace cln {
 
-cl_boolean logtest (const cl_I& x, const cl_I& y)
+bool logtest (const cl_I& x, const cl_I& y)
 {
     // Methode:
     //  Fixnums separat behandeln.
@@ -27,42 +27,42 @@ cl_boolean logtest (const cl_I& x, const cl_I& y)
         if (fixnump(y))
           // beides Fixnums
           { if ((x.word & y.word & cl_combine(0,~(cl_uint)0))==0)
-              return cl_false;
+              return false;
               else
-              return cl_true;
+              return true;
           }
           else
           // x Fixnum, y Bignum, also ist x echt kürzer
-          { if (FN_V_minusp(x,FN_to_V(x))) return cl_true; // x<0 -> ja.
+          { if (FN_V_minusp(x,FN_to_V(x))) return true; // x<0 -> ja.
             // x>=0. Kombiniere x mit den pFN_maxlength letzten Digits von y.
            {var const uintD* yLSDptr;
             var uintV x_ = FN_to_V(x);
             BN_to_NDS_nocopy(y, ,,yLSDptr=);
             #if (pFN_maxlength > 1)
             doconsttimes(pFN_maxlength-1,
-              if (lsprefnext(yLSDptr) & (uintD)x_) return cl_true;
+              if (lsprefnext(yLSDptr) & (uintD)x_) return true;
               x_ = x_ >> intDsize;
               );
             #endif
-            if (lsprefnext(yLSDptr) & (uintD)x_) return cl_true;
-            return cl_false;
+            if (lsprefnext(yLSDptr) & (uintD)x_) return true;
+            return false;
           }}
         else
         if (fixnump(y))
           // x Bignum, y Fixnum, analog wie oben, nur x und y vertauscht
-          { if (FN_V_minusp(y,FN_to_V(y))) return cl_true; // y<0 -> ja.
+          { if (FN_V_minusp(y,FN_to_V(y))) return true; // y<0 -> ja.
             // y>=0. Kombiniere y mit den pFN_maxlength letzten Digits von x.
            {var const uintD* xLSDptr;
             var uintV y_ = FN_to_V(y);
             BN_to_NDS_nocopy(x, ,,xLSDptr=);
             #if (pFN_maxlength > 1)
             doconsttimes(pFN_maxlength-1,
-              if (lsprefnext(xLSDptr) & (uintD)y_) return cl_true;
+              if (lsprefnext(xLSDptr) & (uintD)y_) return true;
               y_ = y_ >> intDsize;
               );
             #endif
-            if (lsprefnext(xLSDptr) & (uintD)y_) return cl_true;
-            return cl_false;
+            if (lsprefnext(xLSDptr) & (uintD)y_) return true;
+            return false;
           }}
           else
           // x,y Bignums
@@ -78,14 +78,14 @@ cl_boolean logtest (const cl_I& x, const cl_I& y)
               { if (xlen<ylen)
                   { // x ist die echt kürzere DS.
                     if ((sintD)mspref(xMSDptr,0)<0) // der echt kürzere ist negativ?
-                      return cl_true;
+                      return true;
                     // Der echt kürzere ist positiv.
                     yMSDptr = yMSDptr mspop (ylen-xlen);
                   }
                   else
                   { // y ist die echt kürzere DS.
                     if ((sintD)mspref(yMSDptr,0)<0) // der echt kürzere ist negativ?
-                      return cl_true;
+                      return true;
                     // Der echt kürzere ist positiv.
                     xMSDptr = xMSDptr mspop (xlen-ylen);
                     xlen = ylen;
index 9df0edfaca85af2f9851933bba2bc00630a01501..fdbe4c185098059b09c6207c1e27e4dd026faeb2 100644 (file)
@@ -21,7 +21,7 @@ const cl_I mkf_extract (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 0; } ); // NDS zu x bilden
+      I_to_NDS_nocopy(x, MSDptr=,len=,LSDptr=,true, { return 0; } ); // NDS zu x bilden
       // MSDptr erhöhen und len erniedrigen, so daß len = ceiling(q/intDsize) wird:
       { var uintC qD = ceiling(q,intDsize); // ceiling(q/intDsize)
         // wegen q<=l ist qD = ceiling(q/intDsize) <= ceiling((l+1)/intDsize) = len, also
index 17bc537313c2c091bd42a1ae7563024202da63a7..5afeb4183b7c51101c97657718a3d686e62c4768 100644 (file)
@@ -77,35 +77,35 @@ inline cl_I::cl_I (cl_heap_bignum* ptr)
 // Integers in general.
 
 // Type tests.
-inline cl_boolean integerp (const cl_I& x)
-       { unused x; return cl_true; }
-inline cl_boolean fixnump (const cl_I& x)
-       { return (cl_boolean) !x.pointer_p(); }
-inline cl_boolean bignump (const cl_I& x)
+inline bool integerp (const cl_I& x)
+       { unused x; return true; }
+inline bool fixnump (const cl_I& x)
+       { return !x.pointer_p(); }
+inline bool bignump (const cl_I& x)
        { return x.pointer_p(); }
 
 // Sign test:
 
 // (MINUSP x) == (< x 0)
-inline cl_boolean minusp (const cl_I& x)
+inline bool minusp (const cl_I& x)
 {
        if (fixnump(x))
                // This assumes cl_value_shift + cl_value_len == cl_pointer_size.
-               return (cl_boolean)((cl_sint) x.word < 0);
+               return (cl_sint) x.word < 0;
        else
-               return (cl_boolean)((sintD)mspref(arrayMSDptr(TheBignum(x)->data,TheBignum(x)->length),0) < 0);
+               return (sintD)mspref(arrayMSDptr(TheBignum(x)->data,TheBignum(x)->length),0) < 0;
 }
 
 // (ZEROP x) == (= x 0)
-inline cl_boolean zerop (const cl_I& x)
+inline bool zerop (const cl_I& x)
 {
-       return (cl_boolean)(x.word == cl_combine(cl_FN_tag,0));
+       return x.word == cl_combine(cl_FN_tag,0);
 }
 
 // (EQ x y) == (= x y), assuming y a fixnum
-inline cl_boolean eq (const cl_I& x, sint32 y)
+inline bool eq (const cl_I& x, sint32 y)
 {
-       return (cl_boolean)(x.word == cl_combine(cl_FN_tag,y));
+       return x.word == cl_combine(cl_FN_tag,y);
 }
 
 
@@ -626,7 +626,7 @@ inline sintD FN_MSD (cl_uint word)
     var uintD CONCAT(FN_store_,__LINE__) [FN_maxlength];               \
     { var const cl_I& obj_from_I_to_NDS = (obj);                       \
       if (fixnump(obj_from_I_to_NDS))                                  \
-        { FN_to_NDS(arrayLSDptr(CONCAT(FN_store_,__LINE__),FN_maxlength), cl_FN_word(obj_from_I_to_NDS), MSDptr_zuweisung,len_zuweisung,LSDptr_zuweisung, cl_true,); } \
+        { FN_to_NDS(arrayLSDptr(CONCAT(FN_store_,__LINE__),FN_maxlength), cl_FN_word(obj_from_I_to_NDS), MSDptr_zuweisung,len_zuweisung,LSDptr_zuweisung, true,); } \
         else                                                              \
         { BN_to_NDS(obj_from_I_to_NDS,MSDptr_zuweisung,len_zuweisung, LSDptr_zuweisung); } \
     }
@@ -641,7 +641,7 @@ inline sintD FN_MSD (cl_uint word)
     var uintD CONCAT(FN_store_,__LINE__) [1+FN_maxlength];             \
     { var const cl_I& obj_from_I_to_NDS = (obj);                       \
       if (fixnump(obj_from_I_to_NDS))                                  \
-        { FN_to_NDS(arrayLSDptr(CONCAT(FN_store_,__LINE__),1+FN_maxlength), cl_FN_word(obj_from_I_to_NDS), MSDptr_zuweisung,len_zuweisung,LSDptr_zuweisung, cl_true,); } \
+        { FN_to_NDS(arrayLSDptr(CONCAT(FN_store_,__LINE__),1+FN_maxlength), cl_FN_word(obj_from_I_to_NDS), MSDptr_zuweisung,len_zuweisung,LSDptr_zuweisung, true,); } \
         else                                                              \
         { BN_to_NDS_1(obj_from_I_to_NDS,MSDptr_zuweisung,len_zuweisung, LSDptr_zuweisung); } \
     }
@@ -680,8 +680,8 @@ inline sintD FN_MSD (cl_uint word)
 // > n: ein Integer >0
 // > Annahme: x > 1 und n < (integer-length x).
 // < w: Integer (expt x (/ n)) falls x eine n-te Potenz
-// < ergebnis: cl_true         ........................, cl_false sonst
-  extern cl_boolean cl_rootp_aux (cl_I x, uintL n, cl_I* w);
+// < ergebnis: true            ........................, false sonst
+  extern bool cl_rootp_aux (cl_I x, uintL n, cl_I* w);
 
 
 // Hilfsfunktion zur Eingabe von Integers
@@ -721,19 +721,19 @@ inline sintD FN_MSD (cl_uint word)
 class cl_FN : public cl_I {
 public:
 // Optimization of method pointer_p().
-       cl_boolean pointer_p() const
-               { return cl_false; }
+       bool pointer_p() const
+               { return false; }
 };
 
-inline cl_boolean fixnump (const cl_FN& x)
-       { unused x; return cl_true; }
-inline cl_boolean bignump (const cl_FN& x)
-       { unused x; return cl_false; }
+inline bool fixnump (const cl_FN& x)
+       { unused x; return true; }
+inline bool bignump (const cl_FN& x)
+       { unused x; return false; }
 
-inline cl_boolean minusp (const cl_FN& x)
+inline bool minusp (const cl_FN& x)
 {
        // This assumes cl_value_shift + cl_value_len == cl_pointer_size.
-       return (cl_boolean)((cl_sint) x.word < 0);
+       return (cl_sint) x.word < 0;
 }
 
 
@@ -743,21 +743,21 @@ inline cl_boolean minusp (const cl_FN& x)
 class cl_BN : public cl_I {
 public:
 // Optimization of method pointer_p().
-       cl_boolean pointer_p() const
-               { return cl_true; }
+       bool pointer_p() const
+               { return true; }
 };
 
-inline cl_boolean fixnump (const cl_BN& x)
-       { unused x; return cl_false; }
-inline cl_boolean bignump (const cl_BN& x)
-       { unused x; return cl_true; }
+inline bool fixnump (const cl_BN& x)
+       { unused x; return false; }
+inline bool bignump (const cl_BN& x)
+       { unused x; return true; }
 
-inline cl_boolean minusp (const cl_BN& x)
+inline bool minusp (const cl_BN& x)
 {
-       return (cl_boolean)((sintD)mspref(arrayMSDptr(TheBignum(x)->data,TheBignum(x)->length),0) < 0);
+       return (sintD)mspref(arrayMSDptr(TheBignum(x)->data,TheBignum(x)->length),0) < 0;
 }
-inline cl_boolean zerop (const cl_BN& x)
-       { unused x; return cl_false; }
+inline bool zerop (const cl_BN& x)
+       { unused x; return false; }
 
 }  // namespace cln
 
index d661b81145f46f5708bdd535ba3aca553220218b..46afb680548296bb2d9ace8e25316ab6aa55dcf8 100644 (file)
@@ -94,7 +94,7 @@ void I_to_digits (const cl_I& X, uintD base, cl_digits* erg)
           var const uintD* MSDptr;
           var uintC len;
           var const uintD* LSDptr;
-          I_to_NDS_nocopy(X, MSDptr=,len=,LSDptr=,cl_false,);
+          I_to_NDS_nocopy(X, MSDptr=,len=,LSDptr=,false,);
           var int b = (base==2 ? 1 : base==4 ? 2 : base==8 ? 3 : base==16 ? 4 : /*base==32*/ 5);
           var uintD carry = 0;
           var int carrybits = 0;
index b88661b884fc599a5954748fed6386a74c71030e..c6adb0558c0259ff7cb1f074eb99c07c1e613282 100644 (file)
@@ -101,7 +101,7 @@ namespace cln {
           // x in NDS umwandeln, als UDS auffassen:
           BN_to_NDS_nocopy(x, x_MSDptr=,x_len=,x_LSDptr=);
           // y in NDS umwandeln, als UDS auffassen:
-          I_to_NDS_nocopy(y, y_MSDptr=,y_len=,y_LSDptr=,/*cl_true*/cl_false,);
+          I_to_NDS_nocopy(y, y_MSDptr=,y_len=,y_LSDptr=,/*true*/false,);
           // dividieren:
          {var DS q;
           var DS r;
index 7946275067c5c5b27ba2a4deed7bad238169eb62..2aaa135882e9c2c6aa7cda03e5637b52b58e290d 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace cln {
 
-cl_boolean equal (const cl_I& x, const cl_I& y)
+bool equal (const cl_I& x, const cl_I& y)
 {
 // Methode:
 // x und y haben gleiches Vorzeichen ->
@@ -30,28 +30,28 @@ cl_boolean equal (const cl_I& x, const cl_I& y)
         if (fixnump(y))
           // x Fixnum, y Fixnum
           { // This assumes cl_value_shift + cl_value_len == cl_pointer_size.
-            return (cl_boolean) ((cl_sint)x.word == (cl_sint)y.word);
+            return (cl_sint)x.word == (cl_sint)y.word;
           }
           else
           // x Fixnum, y Bignum
-          return cl_false;
+          return false;
         else
         // x Bignum
         if (fixnump(y))
           // x Bignum, y Fixnum
-          return cl_false;
+          return false;
           else
           // x Bignum, y Bignum
           if (x.pointer == y.pointer)
-            return cl_true; // gleiche Pointer -> selbe Zahl
+            return true; // gleiche Pointer -> selbe Zahl
             else
             { var uintC xlen = TheBignum(x)->length;
               var uintC ylen = TheBignum(y)->length;
               if (xlen==ylen)
                 // gleiche Länge -> digitweise vergleichen
-                return (cl_boolean) (compare_loop_msp(BN_MSDptr(x),BN_MSDptr(y),xlen) == 0);
+                return compare_loop_msp(BN_MSDptr(x),BN_MSDptr(y),xlen) == 0;
                 else
-                return cl_false;
+                return false;
             }
 }
 
index 120c1dd99b713795901c924e043e77affb71df84..898543c3da831c4798131e36995d9f2a6962a15c 100644 (file)
@@ -15,7 +15,7 @@
 
 namespace cln {
 
-cl_boolean minusp (const cl_I& x)
+bool minusp (const cl_I& x)
 {
        return inline_minusp(x);
 }
index a9de52ca021d2b54c0fc11ef8cd2ddf9dfd7df6e..8db6470fb040fb6af81064767dac473ce348850b 100644 (file)
@@ -52,8 +52,8 @@ const cl_I operator* (const cl_I& x, const cl_I& y)
       var const uintD* yLSDptr;
       var uintD* ergMSDptr;
       var uintC erglen;
-      I_to_NDS_nocopy(x, xMSDptr = , xlen = , xLSDptr = , cl_false,);
-      I_to_NDS_nocopy(y, yMSDptr = , ylen = , yLSDptr = , cl_false,);
+      I_to_NDS_nocopy(x, xMSDptr = , xlen = , xLSDptr = , false,);
+      I_to_NDS_nocopy(y, yMSDptr = , ylen = , yLSDptr = , false,);
       DS_DS_mul_DS(xMSDptr,xlen,xLSDptr,yMSDptr,ylen,yLSDptr, ergMSDptr=,erglen=,);
       return DS_to_I(ergMSDptr,erglen);
 }
index d4d47b0fbf6bf36f158fd024690acecf3e7bc909..0cbd1f5c98a054548b6c624d1e9f0ec320e45346 100644 (file)
 
 namespace cln {
 
-cl_boolean plusp (const cl_I& x)
+bool plusp (const cl_I& x)
 {
        if (inline_minusp(x))
-               return cl_false; // x<0 -> nein
+               return false; // x<0 -> nein
        elif (inline_zerop(x))
-               return cl_false; // x=0 -> nein
+               return false; // x=0 -> nein
        else
-               return cl_true; // sonst ist x>0.
+               return true; // sonst ist x>0.
 }
 
 }  // namespace cln
index 9c8323e4fb1dc1219f3ed771c98c7dfe40a00892..cd48ac302b22630d4dd58fdbae7a349b04186390 100644 (file)
@@ -39,7 +39,7 @@ const cl_I square (const cl_I& x)
       var const uintD* xMSDptr;
       var uintC xlen;
       var const uintD* xLSDptr;
-      I_to_NDS_nocopy(x, xMSDptr = , xlen = , xLSDptr = , cl_false,);
+      I_to_NDS_nocopy(x, xMSDptr = , xlen = , xLSDptr = , false,);
       var uintD* ergMSDptr;
       var uintC erglen = 2*xlen;
       var uintD* ergLSDptr;
index 93b58f285b90613461f7f13fc5802ecaa30592f2..c0537fde6940d80e81fab06d6fb1ccc07ff52678 100644 (file)
@@ -15,7 +15,7 @@
 
 namespace cln {
 
-cl_boolean zerop (const cl_I& x)
+bool zerop (const cl_I& x)
 {
        return inline_zerop(x);
 }
index 357fccfd3c3dbc159baab6d05fcba0265d6cd212..fb418608efc6a1f3666f4b1bfa56cab939fab3fd 100644 (file)
@@ -492,7 +492,7 @@ namespace cln {
                    // b normalisieren:
                    while (mspref(b_MSDptr,0)==0) { msshrink(b_MSDptr); b_len--; }
              }   }
-             if (cl_false)
+             if (false)
                { subtract: // Ersetze (a,b) := (a-b,b).
                  if (!( subfrom_loop_lsp(b_LSDptr,a_LSDptr,b_len) ==0))
                    // Übertrag nach b_len Stellen, muß also a_len=b_len+1 sein.
@@ -501,7 +501,7 @@ namespace cln {
              // a normalisieren:
              while (mspref(a_MSDptr,0)==0) { msshrink(a_MSDptr); a_len--; }
            }
-           if (cl_false)
+           if (false)
              { divide: // Ersetze (a,b) := (b , a mod b).
               {var uintD* old_a_LSDptr = a_LSDptr;
                var DS q;
index b8618de5c2745c4b859bb41eff16010dc338cfe9..8afa2c2062e3352fbf1ca38ceee91611e7b41b31 100644 (file)
@@ -444,7 +444,7 @@ namespace cln {
                    // b normalisieren:
                    while (mspref(b_MSDptr,0)==0) { msshrink(b_MSDptr); b_len--; }
              }   }
-             if (cl_false)
+             if (false)
                { subtract: // Ersetze (a,b) := (a-b,b).
                  NUDS_likobi0_NUDS(&uAa,&uAb); // uAa := uAa + uAb
                  NUDS_likobi0_NUDS(&uBa,&uBb); // uBa := uBa + uBb
@@ -455,7 +455,7 @@ namespace cln {
              // a normalisieren:
              while (mspref(a_MSDptr,0)==0) { msshrink(a_MSDptr); a_len--; }
            }
-           if (cl_false)
+           if (false)
              { divide: // Ersetze (a,b) := (b , a mod b).
               {var uintD* old_a_LSDptr = a_LSDptr;
                var DS q;
index d6a878bcc3b08bf89373c3a555dd5fd29bd83604..cc4849f65b0bb6c0f7f43efcc36d6741d7e0a4e9 100644 (file)
@@ -30,7 +30,7 @@ cl_class cl_class_weak_hashtable_from_integer_to_rcpointer = {
 
 // These are not inline, because they tend to duplicate a lot of template code.
 
-cl_wht_from_integer_to_rcpointer::cl_wht_from_integer_to_rcpointer (cl_boolean (*maygc_htentry) (const cl_htentry_from_integer_to_rcpointer&))
+cl_wht_from_integer_to_rcpointer::cl_wht_from_integer_to_rcpointer (bool (*maygc_htentry) (const cl_htentry_from_integer_to_rcpointer&))
 {
        var cl_heap_weak_hashtable_from_integer_to_rcpointer* ht = new cl_heap_weak_hashtable_from_integer_to_rcpointer (maygc_htentry);
        ht->refcount = 1;
index 50ad5e278b8d4079e0ccd3180f7ade8ae31dd90e..11f4b70ae419db507847b36b95702ca321d0dde2 100644 (file)
@@ -17,7 +17,7 @@ typedef _cl_hashtable_iterator<cl_htentry_from_integer_to_rcpointer> cl_hashtabl
 
 struct cl_wht_from_integer_to_rcpointer : public cl_gcpointer {
        // Constructors.
-       cl_wht_from_integer_to_rcpointer (cl_boolean (*maygc_htentry) (const cl_htentry_from_integer_to_rcpointer&));
+       cl_wht_from_integer_to_rcpointer (bool (*maygc_htentry) (const cl_htentry_from_integer_to_rcpointer&));
        cl_wht_from_integer_to_rcpointer (const cl_wht_from_integer_to_rcpointer&);
        // Assignment operators.
        cl_wht_from_integer_to_rcpointer& operator= (const cl_wht_from_integer_to_rcpointer&);
index 991f7bdb01b29f4fc77510da6cadcc0969e24d26..ce594ea4a21a88bfbe62be31f424ecbd64c27c23 100644 (file)
@@ -18,7 +18,7 @@ cl_read_flags cl_I_read_flags = {
        syntax_integer,
        lsyntax_all,
        10,
-       { float_format_ffloat, float_format_lfloat_min, cl_true }
+       { float_format_ffloat, float_format_lfloat_min, true }
 };
 
 cl_I::cl_I (const char * string)
index eeae222731673b4b5eba286e2ef9331651357f35..1ffd54b176f6e35e6789b7822b548e078b6ee853 100644 (file)
@@ -26,17 +26,17 @@ public:
        char* end_pointer (void) { return buffer+index; }
 };
 
-static cl_boolean number_char_p (char c)
+static bool number_char_p (char c)
 {
        if ((c >= '0') && (c <= '9'))
-               return cl_true;
+               return true;
        if (((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z')))
-               return cl_true;
+               return true;
        switch (c) {
                case '+': case '-': case '.': case '_': case '/':
-                       return cl_true;
+                       return true;
                default:
-                       return cl_false;
+                       return false;
        }
 }
 
index fcbd83976c4c0f1808a609df62a50e966af86e84..c75553d22cbe5de60f93f9e225f756c3280442f9 100644 (file)
@@ -15,19 +15,19 @@ namespace cln {
 
 // Cf. cl_I_p in cl_I_ring.cc.
 // But here, for better inlining in g++, it is preferrable to finish every
-// alternative with either "return cl_true;" or "return cl_false;".
+// alternative with either "return true;" or "return false;".
 
-inline cl_boolean cl_I_p (const cl_number& x)
+inline bool cl_I_p (const cl_number& x)
 {
        if (!x.pointer_p())
                switch (x.nonpointer_tag()) {
                case cl_FN_tag:
-                       return cl_true;
+                       return true;
                }
        else
                if (x.pointer_type() == &cl_class_bignum)
-                       return cl_true;
-       return cl_false;
+                       return true;
+       return false;
 }
 
 const cl_I& cl_I_As (const cl_number& x, const char * filename, int line)
index fedaf17b89607113cfc2af22a6c72572ca89d4cc..27b6ac87e6af0e0056d890a455d2d69edc8cacb3 100644 (file)
 
 namespace cln {
 
-cl_boolean oddp (const cl_I& x)
+bool oddp (const cl_I& x)
 {
        if (fixnump(x)) {
                // Fixnum: Bit 0 abprüfen
                if (x.word & bit(cl_value_shift))
-                       return cl_true;
+                       return true;
                else
-                       return cl_false;
+                       return false;
        } else {
                // Bignum: Bit 0 im letzten Digit abprüfen
                if (lspref(BN_LSDptr(x),0) & bit(0))
-                       return cl_true;
+                       return true;
                else
-                       return cl_false;
+                       return false;
        }
 }
 
index 49391e210a31b22cebcaa876f6392e02bb163efc..27d198a0490be8370c32ab71e15b3e2b9c14f0d1 100644 (file)
@@ -17,11 +17,11 @@ namespace cln {
 
 char * print_integer_to_string (unsigned int base, const cl_I& z)
 {
-       var cl_boolean minus_p = cl_false;
+       var bool minus_p = false;
        var cl_I abs_z;
        if (minusp(z)) {
                // z<0 -> später Vorzeichen ausgeben:
-               minus_p = cl_true;
+               minus_p = true;
                abs_z = -z;
        } else
                abs_z = z;
index de51b84ca8988f6e97afa41f06f6cbc532701025..d05e00b0b81c9d056808c7d839ab3d228aa2aa18 100644 (file)
@@ -21,7 +21,7 @@ const cl_I random_I (random_state& randomstate, const cl_I& n)
        var const uintD* n_MSDptr;
        var uintC n_len;
        var const uintD* n_LSDptr;
-       I_to_NDS_nocopy(n, n_MSDptr=,n_len=,n_LSDptr=,cl_false,); // Digit sequence >0 zu n
+       I_to_NDS_nocopy(n, n_MSDptr=,n_len=,n_LSDptr=,false,); // Digit sequence >0 zu n
        var uintD* MSDptr;
        var uintC len = n_len + ceiling(16,intDsize); // 16 Bits mehr
        // neue UDS mit len Zufallsdigits bilden:
index 5e002423c8889857e7ed3705f10cf44b677ba7fa..1896b4eb704657767ef61ce5f3d6fdfd0224327a 100644 (file)
@@ -18,8 +18,8 @@ namespace cln {
 const cl_I testrandom_I (random_state& randomstate)
 {
   var uint32 ran = random32(randomstate);
-  var cl_boolean negative = (cl_boolean)(ran & 1);
-  var cl_boolean algo = (cl_boolean)((ran>>1) & 1);
+  var bool negative = (ran & 1);
+  var bool algo = ((ran>>1) & 1);
   ran = ran >> 2;
   ran = ran & ((1<<8)-1);
   var uintC len =
index d08287795ed776a3960845749519bb0967609536..722c03876da5e882c2d72749a83647cd460bb2d6 100644 (file)
@@ -40,20 +40,20 @@ static void null_fprint (cl_heap_ring* R, std::ostream& stream, const _cl_ring_e
        fprint(stream,"0");
 }
 
-static cl_boolean null_equal (cl_heap_ring* R, const _cl_ring_element& x, const _cl_ring_element& y)
+static bool null_equal (cl_heap_ring* R, const _cl_ring_element& x, const _cl_ring_element& y)
 {
        unused R;
        unused x;
        unused y;
-       return cl_true;
+       return true;
 }
 
 #define null_zero null_op0
-static cl_boolean null_zerop (cl_heap_ring* R, const _cl_ring_element& x)
+static bool null_zerop (cl_heap_ring* R, const _cl_ring_element& x)
 {
        unused R;
        unused x;
-       return cl_true;
+       return true;
 }
 #define null_plus null_op2
 #define null_minus null_op2
index 0f4e6d76661837c46a27d89113e569c1157b531a..416738a3e97c8dd2c0a8f58dde350f0d19f6d6c9 100644 (file)
@@ -23,7 +23,7 @@ static void I_fprint (cl_heap_ring* R, std::ostream& stream, const _cl_ring_elem
        fprint(stream,The(cl_I)(x));
 }
 
-static cl_boolean I_equal (cl_heap_ring* R, const _cl_ring_element& x, const _cl_ring_element& y)
+static bool I_equal (cl_heap_ring* R, const _cl_ring_element& x, const _cl_ring_element& y)
 {
        unused R;
        return equal(The(cl_I)(x),The(cl_I)(y));
@@ -34,7 +34,7 @@ static const _cl_ring_element I_zero (cl_heap_ring* R)
        return _cl_ring_element(R, (cl_I)0);
 }
 
-static cl_boolean I_zerop (cl_heap_ring* R, const _cl_ring_element& x)
+static bool I_zerop (cl_heap_ring* R, const _cl_ring_element& x)
 {
        unused R;
        return zerop(The(cl_I)(x));
@@ -80,13 +80,11 @@ static const _cl_ring_element I_expt_pos (cl_heap_ring* R, const _cl_ring_elemen
        return _cl_ring_element(R, expt_pos(The(cl_I)(x),y));
 }
 
-static cl_boolean cl_I_p (const cl_number& x)
+static bool cl_I_p (const cl_number& x)
 {
-       return (cl_boolean)
-              (!x.pointer_p()
+       return (!x.pointer_p()
                ? x.nonpointer_tag() == cl_FN_tag
-               : x.pointer_type() == &cl_class_bignum
-              );
+               : x.pointer_type() == &cl_class_bignum);
 }
 
 static cl_ring_setops I_setops = {
index 071028b6bab3ad5a2115ebb8bcfa2fdba418e532..a3d55116e7aecc6f0dd7a0c1e32a7c8845100c29 100644 (file)
@@ -61,7 +61,7 @@ cl_heap_modint_ring::cl_heap_modint_ring (cl_I m, cl_modint_setops* setopv, cl_m
 }
 
 
-static cl_boolean modint_equal (cl_heap_modint_ring* R, const _cl_MI& x, const _cl_MI& y)
+static bool modint_equal (cl_heap_modint_ring* R, const _cl_MI& x, const _cl_MI& y)
 {
        unused R;
        return equal(x.rep,y.rep);
@@ -141,12 +141,12 @@ namespace cln {
 // any more except from the hash table and the ring. Note that the ring contains
 // exactly one reference to the modulus.
 
-static cl_boolean maygc_htentry (const cl_htentry_from_integer_to_rcpointer& entry)
+static bool maygc_htentry (const cl_htentry_from_integer_to_rcpointer& entry)
 {
        if (!entry.key.pointer_p() || (entry.key.heappointer->refcount == 2))
                if (!entry.val.pointer_p() || (entry.val.heappointer->refcount == 1))
-                       return cl_true;
-       return cl_false;
+                       return true;
+       return false;
 }
 
 static const cl_wht_from_integer_to_rcpointer modint_ring_table = cl_wht_from_integer_to_rcpointer(maygc_htentry);
index 0fbfe5280d8b7f99e8a95c004e5c3cb08b23f5ab..f8e6f788dc5a8267a55d859f3d645a4f131e6a2a 100644 (file)
@@ -42,7 +42,7 @@ static const _cl_MI int_zero (cl_heap_modint_ring* R)
        return _cl_MI(R, 0);
 }
 
-static cl_boolean int_zerop (cl_heap_modint_ring* R, const _cl_MI& x)
+static bool int_zerop (cl_heap_modint_ring* R, const _cl_MI& x)
 {
        unused R;
        return zerop(x.rep);
index 0f944c390c4471093b6e499883e62ac8be183a9b..dba300805e34c6420632fdd51df3ecb3b3dcfec2 100644 (file)
@@ -183,7 +183,7 @@ static cl_heap_modint_ring* try_make_modint_ring_montgom (const cl_I& M)
        CL_ALLOCA_STACK;
        var uintC len;
        var const uintD* M_LSDptr;
-       I_to_NDS_nocopy(M, ,len=,M_LSDptr=,cl_false,);
+       I_to_NDS_nocopy(M, ,len=,M_LSDptr=,false,);
        if (lspref(M_LSDptr,len-1)==0) { len--; } // normalize
        // Compute U as 2-adic inverse of M.
        var uintD* U_LSDptr;
@@ -194,7 +194,7 @@ static cl_heap_modint_ring* try_make_modint_ring_montgom (const cl_I& M)
        var uintC i_min;
        var uintC i_max;
        var uintC i = floor(m,2);
-       var cl_boolean negative;
+       var bool negative;
        if (U_bit(i)) {
                for (; --i > 0; )
                        if (!U_bit(i)) break;
@@ -203,7 +203,7 @@ static cl_heap_modint_ring* try_make_modint_ring_montgom (const cl_I& M)
                for (; ++i < m; )
                        if (!U_bit(i)) break;
                i_max = i;
-               negative = cl_true;
+               negative = true;
        } else {
                for (; --i > 0; )
                        if (U_bit(i)) break;
@@ -212,7 +212,7 @@ static cl_heap_modint_ring* try_make_modint_ring_montgom (const cl_I& M)
                for (; ++i < m; )
                        if (U_bit(i)) break;
                i_max = i;
-               negative = cl_false;
+               negative = false;
        }
        #undef U_bit
        // OK, all the bits i_max-1..i_min of U are equal.
index 9daecad99a7abeaf4809b602c612004343e1a4fa..496fa4f7de86049d9b3176e1b9da05d488e227d0 100644 (file)
@@ -22,7 +22,7 @@ static inline const cl_I pow2m1_reduce_modulo (cl_heap_modint_ring* _R, const cl
        //   mod(x,m) = mod(x0+x1+x2+...,m).
        // If x<0, apply this to -1-x, and use mod(x,m) = m-1-mod(-1-x,m).
  {     Mutable(cl_I,x);
-       var cl_boolean sign = minusp(x);
+       var bool sign = minusp(x);
        if (sign) { x = lognot(x); }
        var const uintC m1 = R->m1;
        if (x >= R->modulus) {
index e704cc8f67e58af1ef0dea5e81c2906bc3f5c83a..ede3818d5918cb57e54cba87beaf726ff15daf62 100644 (file)
@@ -35,7 +35,7 @@ static const _cl_MI std_zero (cl_heap_modint_ring* R)
        return _cl_MI(R, 0);
 }
 
-static cl_boolean std_zerop (cl_heap_modint_ring* R, const _cl_MI& x)
+static bool std_zerop (cl_heap_modint_ring* R, const _cl_MI& x)
 {
        unused R;
        return zerop(x.rep);
@@ -208,7 +208,7 @@ static const _cl_MI std_expt_pos (cl_heap_modint_ring* R, const _cl_MI& x, const
                {
                        var const uintD* n_LSDptr;
                        var const uintD* n_MSDptr;
-                       I_to_NDS_nocopy(n, n_MSDptr=,,n_LSDptr=,cl_false,);
+                       I_to_NDS_nocopy(n, n_MSDptr=,,n_LSDptr=,false,);
                        var const uintL k_mask = bit(k)-1;
                        var uintD carry = 0;
                        var unsigned int carrybits = 0;
index 6625e73a62e2d25bee5ee8b45d2c97246b52be2d..9be0f14766d83eecc7e1ef02ad3c8a8f292eb847 100644 (file)
@@ -48,7 +48,7 @@ extern uint32 cl_trialdivision (const cl_I& n, uint32 d1, uint32 d2);
 // Returns true if n looks like a prime (with error probability < 4^-count).
 // Returns false if n is definitely composite, and then sets factor = some
 // nontrivial factor or 0.
-extern cl_boolean cl_miller_rabin_test (const cl_I& n, int count, cl_I* factor);
+extern bool cl_miller_rabin_test (const cl_I& n, int count, cl_I* factor);
 
 }  // namespace cln
 
index cd8b7736dbdb6042a7cff02073bc6c8c2fa8acf0..3d7c99f1f37f477af8dbc5430de128350427d6c0 100644 (file)
@@ -13,7 +13,7 @@
 
 namespace cln {
 
-cl_boolean cl_miller_rabin_test (const cl_I& n, int count, cl_I* factor)
+bool 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
@@ -45,7 +45,7 @@ cl_boolean cl_miller_rabin_test (const cl_I& n, int count, cl_I* factor)
                                // (b-1)*(b+1) == 0 mod n, hence n not prime.
                                if (factor)
                                        *factor = gcd(R->retract(b)-1,n);
-                               return cl_false;
+                               return false;
                        }
                        b = new_b;
                }
@@ -57,11 +57,11 @@ cl_boolean cl_miller_rabin_test (const cl_I& n, int count, cl_I* factor)
                        else
                                *factor = 0;
                }
-               return cl_false;
+               return false;
            passed:
                ;
        }
-       return cl_true;
+       return true;
 }
 
 }  // namespace cln
index e6e2d06e17dfc11a6b267c26e4824282e6cc4872..70f4f6201bb19404a87d061ba567aa470a8f43b7 100644 (file)
@@ -26,7 +26,7 @@ uint32 cl_trialdivision (const cl_I& n, uint32 d1, uint32 d2)
        CL_ALLOCA_STACK;
        var const uintD* n_MSDptr;
        var uintC n_len;
-       I_to_NDS_nocopy(n, n_MSDptr=,n_len=,,cl_false,);
+       I_to_NDS_nocopy(n, n_MSDptr=,n_len=,,false,);
        if (mspref(n_MSDptr,0)==0) { msshrink(n_MSDptr); n_len--; }
        // Make room for a quotient.
        var uintD* q_MSDptr;
index 031fe291dee7bc799b4659ceda82e12c54aa24da..0f248c356f50aa4a3d09fe6738229098aca84f07 100644 (file)
@@ -16,7 +16,7 @@
 
 namespace cln {
 
-cl_boolean isprobprime (const cl_I& n)
+bool isprobprime (const cl_I& n)
 {
        if (!(n > 0)) {
                std::ostringstream buf;
@@ -38,12 +38,12 @@ cl_boolean isprobprime (const cl_I& n)
                        if (i < cl_small_prime_table_size
                            && ((unsigned int) cl_small_prime_table[i] == nn
                                || nn == 2))
-                               return cl_true;
+                               return true;
                        else
-                               return cl_false;
+                               return false;
                }
                if ((nn % 2) == 0 || cl_trialdivision(nn,1,trialdivide_limit))
-                       return cl_false;
+                       return false;
                // For small n, only few Miller-Rabin tests are needed.
                if (nn < 2000U) count = 1; // {2}
                else if (nn < 1300000U) count = 2; // {2,3}
@@ -53,10 +53,10 @@ cl_boolean isprobprime (const cl_I& n)
                var uint32 nhi = cl_I_to_UL(ldb(n,cl_byte(32,32)));
                var uint32 nlo = cl_I_to_UL(ldb(n,cl_byte(32,0)));
                if ((nlo % 2) == 0 || cl_trialdivision(nhi,nlo,1,trialdivide_limit))
-                       return cl_false;
+                       return false;
        } else {
                if (evenp(n) || cl_trialdivision(n,1,trialdivide_limit))
-                       return cl_false;
+                       return false;
        }
        // Step 2: Miller-Rabin test.
        return cl_miller_rabin_test(n,count,NULL);
index 53060308188bdb5fc7addbae6e51939cbd75a47d..32d3866f46c65eb3828e1d9be134533ef2ffcd1e 100644 (file)
@@ -13,7 +13,7 @@ struct cl_heap_GV_I_bits1 : public cl_heap_GV_I {
        uintD data[1];
 };
 
-static cl_boolean gf2_equal (cl_heap_univpoly_ring* UPR, const _cl_UP& x, const _cl_UP& y)
+static bool gf2_equal (cl_heap_univpoly_ring* UPR, const _cl_UP& x, const _cl_UP& y)
 {{
        DeclarePoly(cl_GV_MI,x);
        DeclarePoly(cl_GV_MI,y);
@@ -23,12 +23,12 @@ static cl_boolean gf2_equal (cl_heap_univpoly_ring* UPR, const _cl_UP& x, const
        var uintL xlen = xv->v.length();
        var uintL ylen = yv->v.length();
        if (!(xlen == ylen))
-               return cl_false;
+               return false;
        // We can compare full words since unused bits in the last word are 0.
        var uintL count = ceiling(xlen,intDsize);
        if (compare_loop_up(xv->data,yv->data,count) != 0)
-               return cl_false;
-       return cl_true;
+               return false;
+       return true;
 }}
 
 static const _cl_UP gf2_plus (cl_heap_univpoly_ring* UPR, const _cl_UP& x, const _cl_UP& y)
index f76977a6b1bb7ca17d5fedf62105e69298fbab35..9b672a67dc4752eeb7c1c41f3a371259aa99f6bf 100644 (file)
@@ -60,7 +60,7 @@ static void modint_fprint (cl_heap_univpoly_ring* UPR, std::ostream& stream, con
        }
 }}
 
-static cl_boolean modint_equal (cl_heap_univpoly_ring* UPR, const _cl_UP& x, const _cl_UP& y)
+static bool modint_equal (cl_heap_univpoly_ring* UPR, const _cl_UP& x, const _cl_UP& y)
 {{
        DeclarePoly(cl_GV_MI,x);
        DeclarePoly(cl_GV_MI,y);
@@ -68,11 +68,11 @@ static cl_boolean modint_equal (cl_heap_univpoly_ring* UPR, const _cl_UP& x, con
        var sintL xlen = x.length();
        var sintL ylen = y.length();
        if (!(xlen == ylen))
-               return cl_false;
+               return false;
        for (var sintL i = xlen-1; i >= 0; i--)
                if (!R->_equal(x[i],y[i]))
-                       return cl_false;
-       return cl_true;
+                       return false;
+       return true;
 }}
 
 static const _cl_UP modint_zero (cl_heap_univpoly_ring* UPR)
@@ -80,15 +80,15 @@ static const _cl_UP modint_zero (cl_heap_univpoly_ring* UPR)
        return _cl_UP(UPR, cl_null_GV_I);
 }
 
-static cl_boolean modint_zerop (cl_heap_univpoly_ring* UPR, const _cl_UP& x)
+static bool modint_zerop (cl_heap_univpoly_ring* UPR, const _cl_UP& x)
 {
        unused UPR;
  {     DeclarePoly(cl_GV_MI,x);
        var sintL xlen = x.length();
        if (xlen == 0)
-               return cl_true;
+               return true;
        else
-               return cl_false;
+               return false;
 }}
 
 static const _cl_UP modint_plus (cl_heap_univpoly_ring* UPR, const _cl_UP& x, const _cl_UP& y)
index dcfd6c77a890618d55e31565d2d997c90e6e45ac..e827afdc571af218265a1ace457e7aacad22c14b 100644 (file)
@@ -56,7 +56,7 @@ static void gen_fprint (cl_heap_univpoly_ring* UPR, std::ostream& stream, const
        }
 }}
 
-static cl_boolean gen_equal (cl_heap_univpoly_ring* UPR, const _cl_UP& x, const _cl_UP& y)
+static bool gen_equal (cl_heap_univpoly_ring* UPR, const _cl_UP& x, const _cl_UP& y)
 {{
        DeclarePoly(cl_SV_ringelt,x);
        DeclarePoly(cl_SV_ringelt,y);
@@ -64,11 +64,11 @@ static cl_boolean gen_equal (cl_heap_univpoly_ring* UPR, const _cl_UP& x, const
        var sintL xlen = x.length();
        var sintL ylen = y.length();
        if (!(xlen == ylen))
-               return cl_false;
+               return false;
        for (var sintL i = xlen-1; i >= 0; i--)
                if (!R->_equal(x[i],y[i]))
-                       return cl_false;
-       return cl_true;
+                       return false;
+       return true;
 }}
 
 static const _cl_UP gen_zero (cl_heap_univpoly_ring* UPR)
@@ -76,15 +76,15 @@ static const _cl_UP gen_zero (cl_heap_univpoly_ring* UPR)
        return _cl_UP(UPR, cl_null_SV_ringelt);
 }
 
-static cl_boolean gen_zerop (cl_heap_univpoly_ring* UPR, const _cl_UP& x)
+static bool gen_zerop (cl_heap_univpoly_ring* UPR, const _cl_UP& x)
 {
        unused UPR;
  {     DeclarePoly(cl_SV_ringelt,x);
        var sintL xlen = x.length();
        if (xlen == 0)
-               return cl_true;
+               return true;
        else
-               return cl_false;
+               return false;
 }}
 
 static const _cl_UP gen_plus (cl_heap_univpoly_ring* UPR, const _cl_UP& x, const _cl_UP& y)
index a81adaa254ed889d349116ba007eb20828404e3f..dd797347e9067d8429f63545f3c6f01a3c25e354 100644 (file)
@@ -39,13 +39,13 @@ namespace cln {
 // the ring contains exactly one reference to the base ring and exactly one
 // reference to the name (on the property list).
 
-static cl_boolean maygc_htentry (const cl_htentry_from_rcpointer2_to_rcpointer& entry)
+static bool maygc_htentry (const cl_htentry_from_rcpointer2_to_rcpointer& entry)
 {
        if (!entry.key1.pointer_p() || (entry.key1.heappointer->refcount == 2))
                if (!entry.key2.pointer_p() || (entry.key2.heappointer->refcount == 2))
                        if (!entry.val.pointer_p() || (entry.val.heappointer->refcount == 1))
-                               return cl_true;
-       return cl_false;
+                               return true;
+       return false;
 }
 
 static const cl_wht_from_rcpointer2_to_rcpointer univpoly_ring_table = cl_wht_from_rcpointer2_to_rcpointer(maygc_htentry);
index 334f40ca57ba338c375c1645db0c8d3e8fd8d2db..53aaf2cc20af0e7462f7fdc50da6b4c27e0534be 100644 (file)
@@ -39,14 +39,14 @@ static void dummy_fprint (cl_heap_univpoly_ring* R, std::ostream& stream, const
        unused stream;
        throw uninitialized_exception(x);
 }
-static cl_boolean dummy_equal (cl_heap_univpoly_ring* R, const _cl_UP& x, const _cl_UP& y)
+static bool dummy_equal (cl_heap_univpoly_ring* R, const _cl_UP& x, const _cl_UP& y)
 {
        unused R;
        throw uninitialized_exception(x, y);
 }
 
 #define dummy_zero dummy_op0
-static cl_boolean dummy_zerop (cl_heap_univpoly_ring* R, const _cl_UP& x)
+static bool dummy_zerop (cl_heap_univpoly_ring* R, const _cl_UP& x)
 {
        unused R;
        throw uninitialized_exception(x);
index 4966ec074399552792276cb932c891cfb529b1f4..b6cb8a843bac1772cb32681678c177547b76665a 100644 (file)
@@ -56,7 +56,7 @@ static void num_fprint (cl_heap_univpoly_ring* UPR, std::ostream& stream, const
        }
 }}
 
-static cl_boolean num_equal (cl_heap_univpoly_ring* UPR, const _cl_UP& x, const _cl_UP& y)
+static bool num_equal (cl_heap_univpoly_ring* UPR, const _cl_UP& x, const _cl_UP& y)
 {{
        DeclarePoly(cl_SV_number,x);
        DeclarePoly(cl_SV_number,y);
@@ -64,11 +64,11 @@ static cl_boolean num_equal (cl_heap_univpoly_ring* UPR, const _cl_UP& x, const
        var sintL xlen = x.length();
        var sintL ylen = y.length();
        if (!(xlen == ylen))
-               return cl_false;
+               return false;
        for (var sintL i = xlen-1; i >= 0; i--)
                if (!ops.equal(x[i],y[i]))
-                       return cl_false;
-       return cl_true;
+                       return false;
+       return true;
 }}
 
 static const _cl_UP num_zero (cl_heap_univpoly_ring* UPR)
@@ -76,15 +76,15 @@ static const _cl_UP num_zero (cl_heap_univpoly_ring* UPR)
        return _cl_UP(UPR, cl_null_SV_number);
 }
 
-static cl_boolean num_zerop (cl_heap_univpoly_ring* UPR, const _cl_UP& x)
+static bool num_zerop (cl_heap_univpoly_ring* UPR, const _cl_UP& x)
 {
        unused UPR;
  {     DeclarePoly(cl_SV_number,x);
        var sintL xlen = x.length();
        if (xlen == 0)
-               return cl_true;
+               return true;
        else
-               return cl_false;
+               return false;
 }}
 
 static const _cl_UP num_plus (cl_heap_univpoly_ring* UPR, const _cl_UP& x, const _cl_UP& y)
index 98d93e37ba065f025d8abe7e60be2757a2d6360d..0ca47d26358d224d87f63a2d077fa396ee4f19aa 100644 (file)
@@ -26,12 +26,12 @@ namespace cln {
 // any more except from the hash table and the ring. Note that the ring contains
 // exactly one reference to the base ring.
 
-static cl_boolean maygc_htentry (const cl_htentry_from_rcpointer_to_rcpointer& entry)
+static bool maygc_htentry (const cl_htentry_from_rcpointer_to_rcpointer& entry)
 {
        if (!entry.key.pointer_p() || (entry.key.heappointer->refcount == 2))
                if (!entry.val.pointer_p() || (entry.val.heappointer->refcount == 1))
-                       return cl_true;
-       return cl_false;
+                       return true;
+       return false;
 }
 
 static const cl_wht_from_rcpointer_to_rcpointer univpoly_ring_table = cl_wht_from_rcpointer_to_rcpointer(maygc_htentry);
index 0ad2dbad949e64d895bd1c2ecf266a6e1efc6f7a..70b98c8d66678fe3a2d745173ed509184fd19659 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace cln {
 
-cl_boolean rootp (const cl_RA& x, uintL n, cl_RA* w)
+bool rootp (const cl_RA& x, uintL n, cl_RA* w)
 {
 // Methode:
 // Bei Integers: klar.
@@ -29,13 +29,13 @@ cl_boolean rootp (const cl_RA& x, uintL n, cl_RA* w)
        var const cl_I& b = denominator(x);
        var cl_I d;
        if (!rootp(b,n,&d)) // Nenner auf n-te Potenz testen
-               return cl_false;
+               return false;
        var const cl_I& a = numerator(x);
        var cl_I c;
        if (!rootp(a,n,&c)) // Zähler auf n-te Potenz testen
-               return cl_false;
+               return false;
        // beides n-te Potenzen -> Quotient der Wurzeln bilden
-       *w = I_I_to_RT(c,d); return cl_true;
+       *w = I_I_to_RT(c,d); return true;
 }}
 
 }  // namespace cln
index dc2f9afab3a4f0905efed42671a326f2488e6bd0..66f79693c5672b234fb5b1dd4a5bba6bac8e698b 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace cln {
 
-cl_boolean rootp (const cl_RA& x, const cl_I& n, cl_RA* w)
+bool rootp (const cl_RA& x, const cl_I& n, cl_RA* w)
 {
 // Methode:
 // Bei Integers: klar.
@@ -29,13 +29,13 @@ cl_boolean rootp (const cl_RA& x, const cl_I& n, cl_RA* w)
        var const cl_I& b = denominator(x);
        var cl_I d;
        if (!rootp(b,n,&d)) // Nenner auf n-te Potenz testen
-               return cl_false;
+               return false;
        var const cl_I& a = numerator(x);
        var cl_I c;
        if (!rootp(a,n,&c)) // Zähler auf n-te Potenz testen
-               return cl_false;
+               return false;
        // beides n-te Potenzen -> Quotient der Wurzeln bilden
-       *w = I_I_to_RT(c,d); return cl_true;
+       *w = I_I_to_RT(c,d); return true;
 }}
 
 }  // namespace cln
index f3414829dacaa99d9d763538cd8b5b57962110aa..31174b99edd477b6b9acd48fb7022b4e65dbaf5a 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace cln {
 
-cl_boolean sqrtp (const cl_RA& x, cl_RA* w)
+bool sqrtp (const cl_RA& x, cl_RA* w)
 {
 // Methode:
 // Bei Integers: klar.
@@ -29,13 +29,13 @@ cl_boolean sqrtp (const cl_RA& x, cl_RA* w)
        var const cl_I& b = denominator(x);
        var cl_I d;
        if (!sqrtp(b,&d)) // Nenner auf Quadratzahl testen
-               return cl_false;
+               return false;
        var const cl_I& a = numerator(x);
        var cl_I c;
        if (!sqrtp(a,&c)) // Zähler auf Quadratzahl testen
-               return cl_false;
+               return false;
        // beides Quadratzahlen -> Quotient der Wurzeln bilden
-       *w = I_I_to_RT(c,d); return cl_true;
+       *w = I_I_to_RT(c,d); return true;
 }}
 
 }  // namespace cln
index 1b4c5b1266936774d3b4440479078acf56676945..42441351e6874189352f8b74d773bc5af6433de2 100644 (file)
@@ -45,25 +45,25 @@ inline cl_RA::cl_RA (cl_heap_ratio* ptr)
 #endif
 
 // Type tests.
-inline cl_boolean rationalp (const cl_RA& x)
-       { unused x; return cl_true; }
-inline cl_boolean integerp (const cl_RA& x)
+inline bool rationalp (const cl_RA& x)
+       { unused x; return true; }
+inline bool integerp (const cl_RA& x)
 {
        if (!x.pointer_p())
-               return cl_true;
+               return true;
        else
                if (x.pointer_type() == &cl_class_bignum)
-                       return cl_true;
-       return cl_false;
+                       return true;
+       return false;
 }
-inline cl_boolean ratiop (const cl_RA& x)
+inline bool ratiop (const cl_RA& x)
 {
        if (!x.pointer_p())
-               return cl_false;
+               return false;
        else
                if (x.pointer_type() == &cl_class_bignum)
-                       return cl_false;
-       return cl_true;
+                       return false;
+       return true;
 }
 
 
@@ -74,10 +74,10 @@ class cl_RT : public cl_RA {
 public:
 };
 
-inline cl_boolean integerp (const cl_RT& x)
-       { unused x; return cl_false; }
-inline cl_boolean ratiop (const cl_RT& x)
-       { unused x; return cl_true; }
+inline bool integerp (const cl_RT& x)
+       { unused x; return false; }
+inline bool ratiop (const cl_RT& x)
+       { unused x; return true; }
 
 // Access numerator and denominator.
 inline const cl_I& numerator (const cl_RT& x)
@@ -89,9 +89,9 @@ inline const cl_I& denominator (const cl_RT& x)
 // Sign test:
 
 // (MINUSP x) == (< x 0)
-inline cl_boolean minusp (const cl_RT& x)
+inline bool minusp (const cl_RT& x)
        { return minusp(numerator(x)); }
-inline cl_boolean minusp (const cl_RA& x)
+inline bool minusp (const cl_RA& x)
 {
        if (ratiop(x)) {
                DeclareType(cl_RT,x);
@@ -103,17 +103,17 @@ inline cl_boolean minusp (const cl_RA& x)
 }
 
 // (ZEROP x) == (= x 0)
-inline cl_boolean zerop (const cl_RT& x)
-       { unused x; return cl_false; }
-inline cl_boolean zerop (const cl_RA& x)
+inline bool zerop (const cl_RT& x)
+       { unused x; return false; }
+inline bool zerop (const cl_RA& x)
 {
-       return (cl_boolean)(x.word == cl_combine(cl_FN_tag,0));
+       return x.word == cl_combine(cl_FN_tag,0);
 }
 
 // (EQ x y) == (= x y), assuming y a fixnum
-inline cl_boolean eq (const cl_RA& x, sint32 y)
+inline bool eq (const cl_RA& x, sint32 y)
 {
-       return (cl_boolean)(x.word == cl_combine(cl_FN_tag,y));
+       return x.word == cl_combine(cl_FN_tag,y);
 }
 
 // Liefert zu den Integers a und b mit b>1 und ggT(a,b)=1 den Bruch a/b.
index 9c21c0edd4bed6178b869c6fcf439cc9261d8300..1546ef20fdc398592b442232aacfbf554ed7d19a 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace cln {
 
-cl_boolean equal (const cl_RA& r, const cl_RA& s)
+bool equal (const cl_RA& r, const cl_RA& s)
 {
 // Methode:
 // r,s Integer -> klar
@@ -29,20 +29,20 @@ cl_boolean equal (const cl_RA& r, const cl_RA& s)
                        return equal(r,s);
                } else
                        // r Integer, s Ratio
-                       return cl_false;
+                       return false;
        else
                if (integerp(s))
                        // r Ratio, s Integer
-                       return cl_false;
+                       return false;
                else {
                        DeclareType(cl_RT,r);
                        DeclareType(cl_RT,s);
                        // r,s Ratios
                        if (!equal(numerator(r),numerator(s)))
-                               return cl_false;
+                               return false;
                        if (!equal(denominator(r),denominator(s)))
-                               return cl_false;
-                       return cl_true;
+                               return false;
+                       return true;
                }
 }
 
index 0ae72f696f6c8bac8f3b61d92d3fb0258877143b..f7ed825a2b1c050c52721399af4ffc2881572612 100644 (file)
@@ -15,7 +15,7 @@
 
 namespace cln {
 
-cl_boolean minusp (const cl_RA& x)
+bool minusp (const cl_RA& x)
 {
        return inline_minusp(x);
 }
index e0c99aef29bf9ef6647e0c939753a82a01f0f885..e3ab8bdbe2007e8e7b2543da3ce47f400c439863 100644 (file)
 
 namespace cln {
 
-cl_boolean plusp (const cl_RA& x)
+bool plusp (const cl_RA& x)
 {
        if (inline_minusp(x))
-               return cl_false; // x<0 -> nein
+               return false; // x<0 -> nein
        elif (inline_zerop(x))
-               return cl_false; // x=0 -> nein
+               return false; // x=0 -> nein
        else
-               return cl_true; // sonst ist x>0.
+               return true; // sonst ist x>0.
 }
 
 }  // namespace cln
index e6db433db1ccd14d544442a3100d466f6516137e..6d6f8f9d89dcd0e9d916673105f3c325a7c49e52 100644 (file)
@@ -15,7 +15,7 @@
 
 namespace cln {
 
-cl_boolean zerop (const cl_RA& x)
+bool zerop (const cl_RA& x)
 {
        return inline_zerop(x);
 }
index 13b7c80863a618a4b8065f7181e7b2977eea6a7d..c658c0734eacf5fec1a4b8f6b22477c63d808cf3 100644 (file)
@@ -18,7 +18,7 @@ cl_read_flags cl_RA_read_flags = {
        syntax_rational,
        lsyntax_all,
        10,
-       { float_format_ffloat, float_format_lfloat_min, cl_true }
+       { float_format_ffloat, float_format_lfloat_min, true }
 };
 
 cl_RA::cl_RA (const char * string)
index f14ddce2e05f60bdf639f81e05e93acba8719234..6dd171d61fe13b8747cd619f8c4a186a88d03b16 100644 (file)
@@ -27,17 +27,17 @@ public:
        char* end_pointer (void) { return buffer+index; }
 };
 
-static cl_boolean number_char_p (char c)
+static bool number_char_p (char c)
 {
        if ((c >= '0') && (c <= '9'))
-               return cl_true;
+               return true;
        if (((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z')))
-               return cl_true;
+               return true;
        switch (c) {
                case '+': case '-': case '.': case '_': case '/':
-                       return cl_true;
+                       return true;
                default:
-                       return cl_false;
+                       return false;
        }
 }
 
index 0a35a8d38d818ab44c910518c01955d8a55b0270..0f1d946f02e332ee7283dc1154ecf49f4cfea420 100644 (file)
@@ -15,19 +15,19 @@ namespace cln {
 
 // Cf. cl_RA_p in cl_RA_ring.cc.
 // But here, for better inlining in g++, it is preferrable to finish every
-// alternative with either "return cl_true;" or "return cl_false;".
+// alternative with either "return true;" or "return false;".
 
-inline cl_boolean cl_RA_p (const cl_number& x)
+inline bool cl_RA_p (const cl_number& x)
 {
        if (!x.pointer_p())
                switch (x.nonpointer_tag()) {
                case cl_FN_tag:
-                       return cl_true;
+                       return true;
                }
        else
                if (x.pointer_type()->flags & cl_class_flags_subclass_rational)
-                       return cl_true;
-       return cl_false;
+                       return true;
+       return false;
 }
 
 const cl_RA& cl_RA_As (const cl_number& x, const char * filename, int line)
index a6aef66195ab8d88467e77e0fdd167967ef95875..e7d33f3567a709fc922e09c241088cec31917087 100644 (file)
@@ -23,7 +23,7 @@ static void RA_fprint (cl_heap_ring* R, std::ostream& stream, const _cl_ring_ele
        fprint(stream,The(cl_RA)(x));
 }
 
-static cl_boolean RA_equal (cl_heap_ring* R, const _cl_ring_element& x, const _cl_ring_element& y)
+static bool RA_equal (cl_heap_ring* R, const _cl_ring_element& x, const _cl_ring_element& y)
 {
        unused R;
        return equal(The(cl_RA)(x),The(cl_RA)(y));
@@ -34,7 +34,7 @@ static const _cl_ring_element RA_zero (cl_heap_ring* R)
        return _cl_ring_element(R, (cl_RA)0);
 }
 
-static cl_boolean RA_zerop (cl_heap_ring* R, const _cl_ring_element& x)
+static bool RA_zerop (cl_heap_ring* R, const _cl_ring_element& x)
 {
        unused R;
        return zerop(The(cl_RA)(x));
@@ -80,13 +80,11 @@ static const _cl_ring_element RA_expt_pos (cl_heap_ring* R, const _cl_ring_eleme
        return _cl_ring_element(R, expt_pos(The(cl_RA)(x),y));
 }
 
-static cl_boolean cl_RA_p (const cl_number& x)
+static bool cl_RA_p (const cl_number& x)
 {
-       return (cl_boolean)
-              (!x.pointer_p()
+       return (!x.pointer_p()
                ? x.nonpointer_tag() == cl_FN_tag
-               : (x.pointer_type()->flags & cl_class_flags_subclass_rational) != 0
-              );
+               : (x.pointer_type()->flags & cl_class_flags_subclass_rational) != 0);
 }
 
 static cl_ring_setops RA_setops = {
index aada2f9f76e90ebdbaa14b78e885837bb44959d2..d0e02de22b5b7a5551ba12d689836116ddaa3310 100644 (file)
@@ -15,7 +15,7 @@
 
 namespace cln {
 
-cl_boolean logp (const cl_I& a, const cl_I& b, cl_RA* l)
+bool logp (const cl_I& a, const cl_I& b, cl_RA* l)
 {
 // Methode:
 //   log(a,b) soll Bruch c/d mit teilerfremdem c>=0,d>0 ergeben.
@@ -58,7 +58,7 @@ cl_boolean logp (const cl_I& a, const cl_I& b, cl_RA* l)
                if (a >= b) {
                        var cl_I_div_t div = cl_divide(a,b); // a durch b dividieren
                        if (!eq(div.remainder,0)) // Rest /=0 ?
-                               return cl_false; // -> fertig
+                               return false; // -> fertig
                        a = div.quotient;  // a := a/b
                        ud = uc + ud; vd = vc + vd;
                } else {
@@ -68,7 +68,7 @@ cl_boolean logp (const cl_I& a, const cl_I& b, cl_RA* l)
                }
        }
        // a=1 -> c=0,d=1 -> Ergebnis ud/vd
-       *l = I_I_to_RA(UL_to_I(ud),UL_to_I(vd)); return cl_true;
+       *l = I_I_to_RA(UL_to_I(ud),UL_to_I(vd)); return true;
 }}
 
 }  // namespace cln
index 326ec99cc5d8fc042ed78f71d2c065f5554876dd..84587ebffe2f6ea9f167e65b16c11684c522fbac 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace cln {
 
-cl_boolean logp (const cl_RA& a, const cl_RA& b, cl_RA* pl)
+bool logp (const cl_RA& a, const cl_RA& b, cl_RA* pl)
 {
 // Methode:
 // a=1 -> Ergebnis 0
@@ -32,7 +32,7 @@ cl_boolean logp (const cl_RA& a, const cl_RA& b, cl_RA* pl)
 //              -log(a2/a1,b1/b2) liefern
 
        if (eq(a,1)) { // a=1 -> Ergebnis 0
-               *pl = 0; return cl_true;
+               *pl = 0; return true;
        }
        if (integerp(b)) {
                // b Integer
@@ -47,13 +47,13 @@ cl_boolean logp (const cl_RA& a, const cl_RA& b, cl_RA* pl)
                        var const cl_I& a1 = numerator(a);
                        var const cl_I& a2 = denominator(a);
                        if (!eq(a1,1))
-                               return cl_false;
+                               return false;
                        // a1=1
                        var cl_RA l;
                        if (logp(a2,b,&l)) {
-                               *pl = -l; return cl_true;
+                               *pl = -l; return true;
                        } else
-                               return cl_false;
+                               return false;
                }
        } else {
                // a rational, b Ratio
@@ -69,16 +69,16 @@ cl_boolean logp (const cl_RA& a, const cl_RA& b, cl_RA* pl)
                        if (logp(a2,b2,&l2)) {
                                if (eq(b1,1)) {
                                        if (eq(a1,1))
-                                               { *pl = l2; return cl_true; }
+                                               { *pl = l2; return true; }
                                        else
-                                               return cl_false;
+                                               return false;
                                } else {
                                        var cl_RA l1;
                                        // rationalen log(a1,b1) versuchen
                                        if (logp(a1,b1,&l1))
                                                if (l1 == l2)
-                                                       { *pl = l2; return cl_true; }
-                                       return cl_false;
+                                                       { *pl = l2; return true; }
+                                       return false;
                                }
                        }
                }
@@ -88,19 +88,19 @@ cl_boolean logp (const cl_RA& a, const cl_RA& b, cl_RA* pl)
                        if (logp(a1,b2,&l2)) {
                                if (eq(b1,1)) {
                                        if (eq(a2,1))
-                                               { *pl = -l2; return cl_true; }
+                                               { *pl = -l2; return true; }
                                        else
-                                               return cl_false;
+                                               return false;
                                } else {
                                        var cl_RA l1;
                                        // rationalen log(a2,b1) versuchen
                                        if (logp(a2,b1,&l1))
                                                if (l1 == l2)
-                                                       { *pl = -l2; return cl_true; }
+                                                       { *pl = -l2; return true; }
                                }
                        }
                }
-               return cl_false;
+               return false;
        }
 }
 
index 6023994c5bd5ea837e853d58efe009f517b1ffe1..c6033b51265412bafada5af6d49b888215579a11 100644 (file)
@@ -15,29 +15,29 @@ extern cl_class cl_class_dfloat;
 extern cl_class cl_class_lfloat;
 
 // Type tests.
-inline cl_boolean rationalp (const cl_R& x)
+inline bool rationalp (const cl_R& x)
 {
        if (!x.pointer_p()) {
                if (x.nonpointer_tag() == cl_FN_tag)
-                       return cl_true;
+                       return true;
        } else {
                if (x.pointer_type()->flags & cl_class_flags_subclass_rational)
-                       return cl_true;
+                       return true;
        }
-       return cl_false;
+       return false;
 }
-inline cl_boolean integerp (const cl_R& x)
+inline bool integerp (const cl_R& x)
 {
        if (!x.pointer_p()) {
                if (x.nonpointer_tag() == cl_FN_tag)
-                       return cl_true;
+                       return true;
        } else {
                if (x.pointer_type() == &cl_class_bignum)
-                       return cl_true;
+                       return true;
        }
-       return cl_false;
+       return false;
 }
-inline cl_boolean floatp (const cl_R& x)
+inline bool floatp (const cl_R& x)
 {
        if (!x.pointer_p()) {
                switch (x.nonpointer_tag()) {
@@ -45,22 +45,22 @@ inline cl_boolean floatp (const cl_R& x)
                #if defined(CL_WIDE_POINTERS)
                case cl_FF_tag:
                #endif
-                       return cl_true;
+                       return true;
                }
        } else {
                if (x.pointer_type()->flags & cl_class_flags_subclass_float)
-                       return cl_true;
+                       return true;
        }
-       return cl_false;
+       return false;
 }
 
 // Comparison with a fixnum.
-inline cl_boolean eq (const cl_R& x, sint32 y)
+inline bool eq (const cl_R& x, sint32 y)
 {
-       return (cl_boolean)(x.word == cl_combine(cl_FN_tag,y));
+       return x.word == cl_combine(cl_FN_tag,y);
 }
 
-inline cl_boolean exact_zerop (const cl_R& x)
+inline bool exact_zerop (const cl_R& x)
 {
        return eq(x,0);
 }
index 032ba3f5220400889cd7d93896c945e2b99e49ab..b3060ce4e701d6919ace1673fc22c96c0a662a2a 100644 (file)
 
 namespace cln {
 
-inline cl_boolean equal (const cl_F& x, const cl_F& y)
+inline bool equal (const cl_F& x, const cl_F& y)
 {
-       return (cl_boolean) (compare(x,y) == 0);
+       return compare(x,y) == 0;
 }
 
-cl_boolean equal (const cl_R& x, const cl_R& y)
+bool equal (const cl_R& x, const cl_R& y)
 {
 // Methode:
 // Beide rational oder beide Floats -> klar.
@@ -35,17 +35,17 @@ cl_boolean equal (const cl_R& x, const cl_R& y)
                        return equal(x,y);
                ,       // x rational, y Float -> x in Float umwandeln
                        if (!power2p(denominator(x)))
-                               return cl_false;
+                               return false;
                        if (!equal(cl_float(x,y),y))
-                               return cl_false;
+                               return false;
                        return equal(x,rational(y));
                );
        ,       realcase2(y
                ,       // x Float, y rational -> y in Float umwandeln
                        if (!power2p(denominator(y)))
-                               return cl_false;
+                               return false;
                        if (!equal(x,cl_float(y,x)))
-                               return cl_false;
+                               return false;
                        return equal(rational(x),y);
                ,       // beides Floats
                        return equal(x,y);
index 58e07c089c1d64903db498314af741431d26d371..610148646bea975c0a2ef43b93e17d532c9074a1 100644 (file)
@@ -23,7 +23,7 @@
 
 namespace cln {
 
-cl_boolean minusp (const cl_R& x)
+bool minusp (const cl_R& x)
 #if 0
 GEN_R_OP1_2(x, minusp, return)
 #else // fully inlined, faster
index 3726392cb23f3ec0c828b0a4eeb6b6f0569e5d04..ab8e274157eef9ec6469a3de5151342bb224dcc7 100644 (file)
 
 namespace cln {
 
-cl_boolean plusp (const cl_R& x)
+bool plusp (const cl_R& x)
 {
        if (minusp(x))
-               return cl_false; // x<0 -> nein
+               return false; // x<0 -> nein
        elif (zerop(x))
-               return cl_false; // x=0 -> nein
+               return false; // x=0 -> nein
        else
-               return cl_true; // sonst ist x>0.
+               return true; // sonst ist x>0.
 }
 
 }  // namespace cln
index e4cba8cf19e2dfb466fa554b845e799665b10831..c3a30aaea7c9d1b72a3f60ef41fcf58fd45bd5a0 100644 (file)
@@ -23,7 +23,7 @@
 
 namespace cln {
 
-cl_boolean zerop (const cl_R& x)
+bool zerop (const cl_R& x)
 #if 0
 GEN_R_OP1_2(x, zerop, return)
 #else // fully inlined, faster
index 3580e416c7b9b37ca6d202acfb49236a2e58c699..9d4a42606833dc60112a9e30e4280fc64171f5ec 100644 (file)
@@ -121,7 +121,7 @@ void format_cardinal (std::ostream& stream, const cl_I& argument)
                        arg = thousands;
                } while (arg > 0);
                // Roll back the recursion.
-               var cl_boolean first_piece = cl_true;
+               var bool first_piece = true;
                do {
                        var uintL small = *--small_piece_ptr;
                        var const char * illion = *--illion_ptr;
@@ -130,7 +130,7 @@ void format_cardinal (std::ostream& stream, const cl_I& argument)
                                        fprint(stream,", ");
                                format_small_cardinal(stream,small);
                                fprint(stream,illion);
-                               first_piece = cl_false;
+                               first_piece = false;
                        }
                } until (illion_ptr == &illions[0]);
        }
index caabb20d704b2b622973d5de09bbd90d541ae014..0addbd386e713255303ed76f04795f9d61ffa6b0 100644 (file)
@@ -46,7 +46,7 @@ const digits_with_dot format_float_to_string (const cl_F& arg, const sintL width
                for (sintL i = 1; i <= places; i++) string[i] = '0';
                string[1+places] = '\0';
                return digits_with_dot(string, 1+places,
-                               cl_true, (cl_boolean)(places==0), 0
+                               true, (places==0), 0
                        );
        }
        // significand : Integer >0
@@ -124,10 +124,10 @@ const digits_with_dot format_float_to_string (const cl_F& arg, const sintL width
        //        = 1 + Stelle der 1. signifikanten Ziffer
        //        oder =0, falls k>=0
        // Ausführung der Rundung:
-       var cl_boolean letzte_stelle_p = cl_false; // d oder width angegeben?
+       var bool letzte_stelle_p = false; // d oder width angegeben?
        var sintL letzte_stelle = 0; // falls d oder width angegeben waren:
                                     // Stelle der letzten signifikanten Ziffer
-       var cl_boolean halbzahlig = cl_false; // zeigt an, ob hinten genau ein 0.500000 wegfällt
+       var bool halbzahlig = false; // zeigt an, ob hinten genau ein 0.500000 wegfällt
        do {
                // Solange das Ergebnis auch nach Aufrundung >= 1 bliebe,
                // eine Vorkommastelle mehr einplanen:
@@ -144,7 +144,7 @@ const digits_with_dot format_float_to_string (const cl_F& arg, const sintL width
                        if (dmin > 0)
                                if (letzte_stelle > -dmin)
                                        letzte_stelle = -dmin;
-                       letzte_stelle_p = cl_true;
+                       letzte_stelle_p = true;
                }
                elif (width > 0) {
                        // Falls nicht d, nur width angegeben:
@@ -160,7 +160,7 @@ const digits_with_dot format_float_to_string (const cl_F& arg, const sintL width
                        if (dmin > 0)
                                if (letzte_stelle > -dmin)
                                        letzte_stelle = -dmin;
-                       letzte_stelle_p = cl_true;
+                       letzte_stelle_p = true;
                }
                if (letzte_stelle_p) {
                        var sintL ziffernzahl = letzte_stelle - stelle;
@@ -180,7 +180,7 @@ const digits_with_dot format_float_to_string (const cl_F& arg, const sintL width
                                aufrund_einh = dezimal_einh;
                        // Jetzt darf auch um eine (halbe) DEZIMAL-Einheit gerundet werden.
                        if (aufrund_einh == dezimal_einh)
-                               halbzahlig = cl_true;
+                               halbzahlig = true;
                }
        } until (((numerator << 1) + aufrund_einh) < (denominator << 1));
        // stelle = Position der ersten signifikanten Stelle + 1
@@ -225,7 +225,7 @@ const digits_with_dot format_float_to_string (const cl_F& arg, const sintL width
                digit_count++;
        }
        // letzte signifikante Ziffer ausgeben:
-       if (letzte_stelle_p ? (cl_boolean)(stelle >= letzte_stelle) : cl_true) {
+       if (letzte_stelle_p ? (stelle >= letzte_stelle) : true) {
                digit = (abrunden && !aufrunden ? digit :
                         aufrunden && !abrunden ? digit+1 :
                         (numerator<<1) <= denominator ? digit : digit+1);
@@ -247,8 +247,8 @@ const digits_with_dot format_float_to_string (const cl_F& arg, const sintL width
                        digit_count++;
                }
        return digits_with_dot(digitstring.contents(), digit_count+1,
-                       (cl_boolean)(point_pos==0),
-                       (cl_boolean)(point_pos==digit_count),
+                       point_pos==0,
+                       point_pos==digit_count,
                        point_pos
                );
 }
index 5446773e9546cf94e2af50ba6b8c954c3e61a7e3..ec206228778be571813446a16ab3cc89aa6cae62 100644 (file)
@@ -17,8 +17,8 @@ namespace cln {
 
 void format_integer (std::ostream& stream, const cl_I& arg,
        unsigned int base, sintL mincol, char padchar,
-       char commachar, uintL commainterval, cl_boolean commaflag,
-       cl_boolean positive_sign_flag)
+       char commachar, uintL commainterval, bool commaflag,
+       bool positive_sign_flag)
 {
        if ((mincol == 0) && !commaflag && !positive_sign_flag) {
                // Normale Ausgabe tut's.
@@ -29,7 +29,7 @@ void format_integer (std::ostream& stream, const cl_I& arg,
        var uintL oldstring_length = ::strlen(oldstring);
        var uintL number_of_digits = (minusp(arg) ? oldstring_length-1 : oldstring_length);
        var uintL number_of_commas = (commaflag ? floor(number_of_digits-1,commainterval) : 0);
-       var cl_boolean positive_sign = (cl_boolean) (positive_sign_flag && (arg > 0));
+       var bool positive_sign = positive_sign_flag && (arg > 0);
        var uintL newstring_length = (positive_sign ? 1 : 0) + oldstring_length + number_of_commas;
        var char* newstring = (char *) malloc_hook(newstring_length+1);
        newstring[newstring_length] = '\0'; // newstring termination
@@ -56,7 +56,7 @@ void format_integer (std::ostream& stream, const cl_I& arg,
                }
        }
 #if 0
-       format_padded_string(stream,mincol,1,0,padchar,cl_true,newstring);
+       format_padded_string(stream,mincol,1,0,padchar,true,newstring);
 #else // expand this special case of format_padded_string inline:
        if ((sintL)newstring_length < mincol)
                format_padding(stream,mincol-newstring_length,padchar);
index 1dd9879b6c0a093bca019f309a07373e521393f8..20b0b39bbe89d997a13910644019a68879272715 100644 (file)
@@ -13,7 +13,7 @@
 
 namespace cln {
 
-void format_padded_string (std::ostream& stream, sintL mincol, sintL colinc, sintL minpad, char padchar, cl_boolean padleftflag, const char * str)
+void format_padded_string (std::ostream& stream, sintL mincol, sintL colinc, sintL minpad, char padchar, bool padleftflag, const char * str)
 {
        var sintL need = ::strlen(str) + minpad; // so viele Zeichen mindestens
        var uintL auxpad = (need < mincol
index 4c29f0b83b4ad42e2cb912f07a4369f3c36769e3..a13d55154f524ebf727772d4b5dc56d6e52167b2 100644 (file)
@@ -37,14 +37,14 @@ inline void format_padding (std::ostream& stream, sintL count, char ch)
 // werden mindestens minpad Zeichen eingefügt, eventuelle weitere dann in
 // Blöcken à colinc Zeichen. Falls padleftflag, werden sie links eingefügt,
 // sonst rechts vom String.
-extern void format_padded_string (std::ostream& stream, sintL mincol, sintL colinc, sintL minpad, char padchar, cl_boolean padleftflag, const char * str);
+extern void format_padded_string (std::ostream& stream, sintL mincol, sintL colinc, sintL minpad, char padchar, bool padleftflag, const char * str);
 
 // gibt den Integer arg auf den Stream aus:
 // in Zahlenbasis base, mit Vorzeichen (+ nur falls >0 und positive-sign-flag),
 // bei commaflag alle drei Stellen unterbrochen durch ein Zeichen commachar.
 // Das Ganze links aufgefüllt mit padchar's, so daß die Gesamtbreite mindestens
 // mincol ist.
-extern void format_integer (std::ostream& stream, const cl_I& arg, unsigned int base, sintL mincol, char padchar, char commachar, uintL commainterval, cl_boolean commaflag, cl_boolean positive_sign_flag);
+extern void format_integer (std::ostream& stream, const cl_I& arg, unsigned int base, sintL mincol, char padchar, char commachar, uintL commainterval, bool commaflag, bool positive_sign_flag);
 
 // format_scale_exponent(arg) liefert zur Floating-Point-Zahl arg
 // drei Werte: mantissa und n, mit
@@ -62,11 +62,11 @@ CL_REQUIRE(cl_fmt_scaleexp)
 struct digits_with_dot {
        char * string; // Mit malloc_hook() alloziert, mit free_hook() freizugeben.
        uintL length; // strlen(string)
-       cl_boolean dot_comes_first; // string[0] == '.' ?
-       cl_boolean dot_comes_last; // string[strlen(string)-1] == '.' ?
+       bool dot_comes_first; // string[0] == '.' ?
+       bool dot_comes_last; // string[strlen(string)-1] == '.' ?
        uintL dot_position; // string[dot_position] is '.'
 // Constructor.
-       digits_with_dot (char* s, uintL l, cl_boolean df, cl_boolean dl, uintL dp)
+       digits_with_dot (char* s, uintL l, bool df, bool dl, uintL dp)
                : string(s), length(l), dot_comes_first(df), dot_comes_last(dl), dot_position(dp) {}
 };
 extern const digits_with_dot format_float_to_string (const cl_F& arg, const sintL width, const sintL d, const sintL k, const sintL dmin);
index b3b3c9f2d5a0b5a18d1522a51fdf916c11c5442a..346530e2211fdea1fe813fb7b83a55892d6e2411 100644 (file)
@@ -18,7 +18,7 @@ cl_read_flags cl_R_read_flags = {
        syntax_real,
        lsyntax_all,
        10,
-       { float_format_ffloat, float_format_lfloat_min, cl_true }
+       { float_format_ffloat, float_format_lfloat_min, true }
 };
 
 cl_R::cl_R (const char * string)
index 940e9e9cf687fc9a07c6124d1dae05d8c1650e42..f0e77bbe636f2ea10150df17a0c6b5a9e13ac041 100644 (file)
@@ -165,29 +165,29 @@ not_rational_syntax:
                }
                var const char * ptr_after_sign = ptr;
                var const char * ptr_after_intpart = skip_digits(ptr_after_sign,string_limit,float_base);
-               var cl_boolean have_dot = cl_false;
+               var bool have_dot = false;
                var const char * ptr_before_fracpart = ptr_after_intpart;
                var const char * ptr_after_fracpart = ptr_after_intpart;
                ptr = ptr_after_intpart;
                if (ptr != string_limit)
                  if (*ptr == '.') {
-                       have_dot = cl_true;
+                       have_dot = true;
                        ptr_before_fracpart = ptr+1;
                        ptr_after_fracpart = skip_digits(ptr_before_fracpart,string_limit,float_base);
                }
                ptr = ptr_after_fracpart;
                var char exponent_marker;
-               var cl_boolean have_exponent;
+               var bool have_exponent;
                var const char * ptr_in_exponent = ptr;
                var const char * ptr_after_exponent = ptr;
                if ((ptr == string_limit) || !(((*ptr >= '0') && (*ptr <= '9')) || ((*ptr >= 'A') && (*ptr <= 'Z') && (*ptr != 'I')) || ((*ptr >= 'a') && (*ptr <= 'z') && (*ptr != 'i')) || (*ptr == '.') || (*ptr == '/'))) {
                        // No exponent.
-                       have_exponent = cl_false;
+                       have_exponent = false;
                        // Must have at least one fractional part digit.
                        if (ptr_after_fracpart == ptr_before_fracpart) goto not_float_syntax;
                        exponent_marker = 'E';
                } else {
-                       have_exponent = cl_true;
+                       have_exponent = true;
                        // Must have at least one digit.
                        if (ptr_after_sign == ptr_after_intpart)
                                if (ptr_after_fracpart == ptr_before_fracpart)
index 3f5979e580e393742c77213327076c383b71eccb..8415c1527c8c9d4f84128799a6907611b35070a0 100644 (file)
@@ -26,17 +26,17 @@ public:
        char* end_pointer (void) { return buffer+index; }
 };
 
-static cl_boolean number_char_p (char c)
+static bool number_char_p (char c)
 {
        if ((c >= '0') && (c <= '9'))
-               return cl_true;
+               return true;
        if (((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z')))
-               return cl_true;
+               return true;
        switch (c) {
                case '+': case '-': case '.': case '_': case '/':
-                       return cl_true;
+                       return true;
                default:
-                       return cl_false;
+                       return false;
        }
 }
 
index a219e23ab5faf4765a5c839cf58395f2c21c1457..cb0824a7c38c8ef384fc8c108a09e0f822caa6b6 100644 (file)
@@ -15,9 +15,9 @@ namespace cln {
 
 // Cf. cl_R_p in cl_R_ring.cc.
 // But here, for better inlining in g++, it is preferrable to finish every
-// alternative with either "return cl_true;" or "return cl_false;".
+// alternative with either "return true;" or "return false;".
 
-inline cl_boolean cl_R_p (const cl_number& x)
+inline bool cl_R_p (const cl_number& x)
 {
        if (!x.pointer_p())
                switch (x.nonpointer_tag()) {
@@ -26,12 +26,12 @@ inline cl_boolean cl_R_p (const cl_number& x)
                #if defined(CL_WIDE_POINTERS)
                case cl_FF_tag:
                #endif
-                       return cl_true;
+                       return true;
                }
        else
                if (x.pointer_type()->flags & cl_class_flags_subclass_real)
-                       return cl_true;
-       return cl_false;
+                       return true;
+       return false;
 }
 
 const cl_R& cl_R_As (const cl_number& x, const char * filename, int line)
index 6988eae57583590213981e4bd8e0aef363492d6b..14d5425abe0db0030d704de3934527b5033168f0 100644 (file)
@@ -51,7 +51,7 @@ inline const cl_R expt_pos (const cl_R& x, const cl_I& y)
 const cl_R expt (const cl_R& x, const cl_I& y)
 {
        if (eq(y,0)) { return 1; } // y=0 -> Ergebnis 1
-       var cl_boolean y_negative = minusp(y);
+       var bool y_negative = minusp(y);
        var cl_I abs_y = (y_negative ? -y : y); // Betrag von y nehmen
        var cl_R z = expt_pos(x,abs_y); // (expt x (abs y))
        return (y_negative ? recip(z) : z); // evtl. noch Kehrwert nehmen
index f7330cef64d7ed8bcce796aa86740a92b27cbfc9..5350bddd99d9a8c2fd37c789bdc6bd8dd34dda75 100644 (file)
@@ -24,7 +24,7 @@ static void R_fprint (cl_heap_ring* R, std::ostream& stream, const _cl_ring_elem
        fprint(stream,The(cl_R)(x));
 }
 
-static cl_boolean R_equal (cl_heap_ring* R, const _cl_ring_element& x, const _cl_ring_element& y)
+static bool R_equal (cl_heap_ring* R, const _cl_ring_element& x, const _cl_ring_element& y)
 {
        unused R;
        return equal(The(cl_R)(x),The(cl_R)(y));
@@ -35,7 +35,7 @@ static const _cl_ring_element R_zero (cl_heap_ring* R)
        return _cl_ring_element(R, (cl_R)0);
 }
 
-static cl_boolean R_zerop (cl_heap_ring* R, const _cl_ring_element& x)
+static bool R_zerop (cl_heap_ring* R, const _cl_ring_element& x)
 {
        unused R;
        // Here we return true only if x is the *exact* zero. Because we
@@ -85,12 +85,10 @@ static const _cl_ring_element R_expt_pos (cl_heap_ring* R, const _cl_ring_elemen
        return _cl_ring_element(R, expt(The(cl_R)(x),y));
 }
 
-static cl_boolean cl_R_p (const cl_number& x)
+static bool cl_R_p (const cl_number& x)
 {
-       return (cl_boolean)
-              (!x.pointer_p()
-               || (x.pointer_type()->flags & cl_class_flags_subclass_real) != 0
-              );
+       return (!x.pointer_p()
+               || (x.pointer_type()->flags & cl_class_flags_subclass_real) != 0);
 }
 
 static cl_ring_setops R_setops = {
index 136eb56a9f0c908cb444b70726721afac8179894..81572005007afc137862a7fbc3a78b1668fea65c 100644 (file)
@@ -49,7 +49,7 @@ int main (int argc, char* argv[])
 #if 0
        cl_I a = "77371252437321868671713407";
        cl_I w;
-       cl_boolean squarep = isqrt(a,&w);
+       bool squarep = isqrt(a,&w);
        DUMP(squarep);
        DUMP(w);
        DUMP(expt_pos(w,2) <= a);
index 6813b76924f5657920da1612f2d98716e6cc5629..541dcdc79f3da82377d1d7cb8a1c6a8a29cbff15 100644 (file)
@@ -9,7 +9,7 @@ int test_I_isqrt (int iterations)
                cl_I a = testrandom_I();
                if (a >= 0) {
                        cl_I w;
-                       cl_boolean squarep = isqrt(a,&w);
+                       bool squarep = isqrt(a,&w);
                        ASSERT1(w >= 0 && expt_pos(w,2) <= a && a < expt_pos(w+1,2), a);
                        ASSERT1(squarep ? w*w==a : w*w<a, a);
                }
index cc70dcfbdf1e301ef8555a3bff6de52431946dda..78e1b5871bf7a7cb09a8022ba341c3f96a630d89 100644 (file)
@@ -10,9 +10,9 @@ int test_I_sqrtp (int iterations)
                cl_I a = testrandom_I();
                if (a >= 0) {
                        cl_I w;
-                       cl_boolean squarep = sqrtp(a,&w);
+                       bool squarep = sqrtp(a,&w);
                        cl_I correct_w;
-                       cl_boolean correct_squarep = isqrt(a,&correct_w);
+                       bool correct_squarep = isqrt(a,&correct_w);
                        ASSERT1(squarep == correct_squarep, a);
                        if (squarep)
                                ASSERT1(w == correct_w, a);