Browse Source

* */*: Remove cl_boolean, cl_true, and cl_false in favor of built-in

C++ bool, true, and false.
master
Richard Kreckel 18 years ago
parent
commit
5370ad8054
  1. 5
      ChangeLog
  2. 1
      NEWS
  3. 52
      doc/cln.tex
  4. 4
      include/cln/complex.h
  5. 6
      include/cln/dfloat.h
  6. 4
      include/cln/dfloat_class.h
  7. 6
      include/cln/ffloat.h
  8. 6
      include/cln/ffloat_class.h
  9. 8
      include/cln/float.h
  10. 2
      include/cln/input.h
  11. 38
      include/cln/integer.h
  12. 6
      include/cln/lfloat.h
  13. 4
      include/cln/lfloat_class.h
  14. 14
      include/cln/modinteger.h
  15. 2
      include/cln/numtheory.h
  16. 20
      include/cln/object.h
  17. 12
      include/cln/output.h
  18. 26
      include/cln/rational.h
  19. 8
      include/cln/real.h
  20. 22
      include/cln/ring.h
  21. 6
      include/cln/sfloat.h
  22. 4
      include/cln/sfloat_class.h
  23. 10
      include/cln/types.h
  24. 18
      include/cln/univpoly.h
  25. 4
      include/cln/univpoly_complex.h
  26. 4
      include/cln/univpoly_integer.h
  27. 4
      include/cln/univpoly_modint.h
  28. 4
      include/cln/univpoly_rational.h
  29. 4
      include/cln/univpoly_real.h
  30. 16
      src/base/digitseq/cl_2DS_div.cc
  31. 40
      src/base/digitseq/cl_DS.h
  32. 16
      src/base/digitseq/cl_DS_div.cc
  33. 12
      src/base/digitseq/cl_DS_mul.cc
  34. 4
      src/base/digitseq/cl_DS_mul_kara.h
  35. 22
      src/base/digitseq/cl_DS_sqrt.cc
  36. 4
      src/base/hash/cl_hash.h
  37. 18
      src/base/hash/cl_hash1weak.h
  38. 18
      src/base/hash/cl_hash2weak.h
  39. 14
      src/base/hash/cl_hashuniqweak.h
  40. 2
      src/base/hash/cl_rcpointer2_hashweak_rcpointer.cc
  41. 2
      src/base/hash/cl_rcpointer2_hashweak_rcpointer.h
  42. 2
      src/base/hash/cl_rcpointer_hashweak_rcpointer.cc
  43. 2
      src/base/hash/cl_rcpointer_hashweak_rcpointer.h
  44. 6
      src/base/output/cl_prin_globals.cc
  45. 4
      src/base/ring/cl_no_ring.cc
  46. 26
      src/complex/cl_C.h
  47. 12
      src/complex/elem/cl_C_equal.cc
  48. 6
      src/complex/elem/cl_C_zerop.cc
  49. 2
      src/complex/input/cl_N_from_string.cc
  50. 10
      src/complex/input/cl_N_read.cc
  51. 10
      src/complex/input/cl_N_read_stream.cc
  52. 2
      src/complex/misc/cl_C_expt_I.cc
  53. 10
      src/complex/misc/cl_N_as.cc
  54. 12
      src/complex/ring/cl_C_ring.cc
  55. 2
      src/complex/transcendental/cl_C_expt_C.cc
  56. 2
      src/float/base/cl_F_globals.cc
  57. 6
      src/float/cl_F.h
  58. 4
      src/float/dfloat/algebraic/cl_DF_sqrt.cc
  59. 2
      src/float/dfloat/conv/cl_I_to_double.cc
  60. 2
      src/float/dfloat/elem/cl_DF_from_I.cc
  61. 6
      src/float/dfloat/elem/cl_DF_minusp.cc
  62. 8
      src/float/dfloat/elem/cl_DF_plusp.cc
  63. 6
      src/float/dfloat/elem/cl_DF_zerop.cc
  64. 2
      src/float/dfloat/input/cl_DF_from_string.cc
  65. 6
      src/float/dfloat/misc/cl_DF_as.cc
  66. 2
      src/float/elem/cl_F_minusp.cc
  67. 2
      src/float/elem/cl_F_plusp.cc
  68. 2
      src/float/elem/cl_F_zerop.cc
  69. 2
      src/float/ffloat/conv/cl_I_to_float.cc
  70. 2
      src/float/ffloat/elem/cl_FF_from_I.cc
  71. 4
      src/float/ffloat/elem/cl_FF_minusp.cc
  72. 8
      src/float/ffloat/elem/cl_FF_plusp.cc
  73. 4
      src/float/ffloat/elem/cl_FF_zerop.cc
  74. 2
      src/float/ffloat/input/cl_FF_from_string.cc
  75. 8
      src/float/ffloat/misc/cl_FF_as.cc
  76. 2
      src/float/input/cl_F_from_string.cc
  77. 10
      src/float/input/cl_F_read.cc
  78. 10
      src/float/input/cl_F_read_stream.cc
  79. 2
      src/float/lfloat/algebraic/cl_LF_sqrt.cc
  80. 2
      src/float/lfloat/elem/cl_LF_I_div.cc
  81. 2
      src/float/lfloat/elem/cl_LF_I_mul.cc
  82. 2
      src/float/lfloat/elem/cl_LF_from_I.cc
  83. 4
      src/float/lfloat/elem/cl_LF_minusp.cc
  84. 8
      src/float/lfloat/elem/cl_LF_plusp.cc
  85. 4
      src/float/lfloat/elem/cl_LF_zerop.cc
  86. 2
      src/float/lfloat/input/cl_LF_from_string.cc
  87. 6
      src/float/lfloat/misc/cl_LF_as.cc
  88. 8
      src/float/misc/cl_F_as.cc
  89. 4
      src/float/output/cl_F_dprint.cc
  90. 2
      src/float/sfloat/elem/cl_SF_from_I.cc
  91. 4
      src/float/sfloat/elem/cl_SF_minusp.cc
  92. 8
      src/float/sfloat/elem/cl_SF_plusp.cc
  93. 4
      src/float/sfloat/elem/cl_SF_zerop.cc
  94. 2
      src/float/sfloat/input/cl_SF_from_string.cc
  95. 6
      src/float/sfloat/misc/cl_SF_as.cc
  96. 4
      src/float/transcendental/cl_F_atanx.cc
  97. 4
      src/float/transcendental/cl_F_expx.cc
  98. 4
      src/float/transcendental/cl_F_lnx.cc
  99. 4
      src/float/transcendental/cl_LF_coshsinh.cc
  100. 4
      src/float/transcendental/cl_LF_cossin.cc

5
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:

1
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.

52
doc/cln.tex

@ -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

4
include/cln/complex.h

@ -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);

6
include/cln/dfloat.h

@ -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);

4
include/cln/dfloat_class.h

@ -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.

6
include/cln/ffloat.h

@ -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);

6
include/cln/ffloat_class.h

@ -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);

8
include/cln/float.h

@ -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

2
include/cln/input.h

@ -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.

38
include/cln/integer.h

@ -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.

6
include/cln/lfloat.h

@ -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);

4
include/cln/lfloat_class.h

@ -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.

14
include/cln/modinteger.h

@ -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.

2
include/cln/numtheory.h

@ -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);

20
include/cln/object.h

@ -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); }

12
include/cln/output.h

@ -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 {};

26
include/cln/rational.h

@ -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);

8
include/cln/real.h

@ -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);

22
include/cln/ring.h

@ -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);
}

6
include/cln/sfloat.h

@ -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);

4
include/cln/sfloat_class.h

@ -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.

10
include/cln/types.h

@ -68,16 +68,6 @@
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

18
include/cln/univpoly.h

@ -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);
}

4
include/cln/univpoly_complex.h

@ -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);
}

4
include/cln/univpoly_integer.h

@ -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);
}

4
include/cln/univpoly_modint.h

@ -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);
}

4
include/cln/univpoly_rational.h

@ -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);
}

4
include/cln/univpoly_real.h

@ -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);
}

16
src/base/digitseq/cl_2DS_div.cc

@ -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

40
src/base/digitseq/cl_DS.h

@ -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

16
src/base/digitseq/cl_DS_div.cc

@ -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

12
src/base/digitseq/cl_DS_mul.cc

@ -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

4
src/base/digitseq/cl_DS_mul_kara.h

@ -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:
@ -130,7 +130,7 @@
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 =

22
src/base/digitseq/cl_DS_sqrt.cc

@ -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)).

4
src/base/hash/cl_hash.h

@ -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>

18
src/base/hash/cl_hash1weak.h

@ -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;
}
};

18
src/base/hash/cl_hash2weak.h

@ -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;
}
};

14
src/base/hash/cl_hashuniqweak.h

@ -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;
}
};

2
src/base/hash/cl_rcpointer2_hashweak_rcpointer.cc

@ -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;

2
src/base/hash/cl_rcpointer2_hashweak_rcpointer.h

@ -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&);

2
src/base/hash/cl_rcpointer_hashweak_rcpointer.cc

@ -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;

2
src/base/hash/cl_rcpointer_hashweak_rcpointer.h

@ -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&);

6
src/base/output/cl_prin_globals.cc

@ -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";
}

4
src/base/ring/cl_no_ring.cc

@ -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);

26
src/complex/cl_C.h

@ -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.

12
src/complex/elem/cl_C_equal.cc

@ -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;
}
}
}

6
src/complex/elem/cl_C_zerop.cc

@ -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;
}
}

2
src/complex/input/cl_N_from_string.cc

@ -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)

10
src/complex/input/cl_N_read.cc

@ -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)

10
src/complex/input/cl_N_read_stream.cc

@ -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;
}
}

2
src/complex/misc/cl_C_expt_I.cc

@ -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

10
src/complex/misc/cl_N_as.cc

@ -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)

12
src/complex/ring/cl_C_ring.cc

@ -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 = {

2
src/complex/transcendental/cl_C_expt_C.cc

@ -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);

2
src/float/base/cl_F_globals.cc

@ -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;

6
src/float/cl_F.h

@ -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.

4
src/float/dfloat/algebraic/cl_DF_sqrt.cc

@ -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;

2
src/float/dfloat/conv/cl_I_to_double.cc

@ -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).

2
src/float/dfloat/elem/cl_DF_from_I.cc

@ -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).

6
src/float/dfloat/elem/cl_DF_minusp.cc

@ -14,12 +14,12 @@
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
}

8
src/float/dfloat/elem/cl_DF_plusp.cc

@ -19,14 +19,14 @@
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

6
src/float/dfloat/elem/cl_DF_zerop.cc

@ -14,12 +14,12 @@
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
}

2
src/float/dfloat/input/cl_DF_from_string.cc

@ -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)

6
src/float/dfloat/misc/cl_DF_as.cc

@ -13,12 +13,12 @@
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)

2
src/float/elem/cl_F_minusp.cc

@ -20,7 +20,7 @@
namespace cln {
cl_boolean minusp (const cl_F& x)
bool minusp (const cl_F& x)
{
floatcase(x
, return minusp(x);

2
src/float/elem/cl_F_plusp.cc

@ -20,7 +20,7 @@
namespace cln {
cl_boolean plusp (const cl_F& x)
bool plusp (const cl_F& x)
{
floatcase(x
, return plusp(x);

2
src/float/elem/cl_F_zerop.cc

@ -20,7 +20,7 @@
namespace cln {
cl_boolean zerop (const cl_F& x)
bool zerop (const cl_F& x)
{
floatcase(x
, return zerop(x);

2
src/float/ffloat/conv/cl_I_to_float.cc

@ -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).

2
src/float/ffloat/elem/cl_FF_from_I.cc

@ -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).

4
src/float/ffloat/elem/cl_FF_minusp.cc

@ -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

8
src/float/ffloat/elem/cl_FF_plusp.cc

@ -19,14 +19,14 @@
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

4
src/float/ffloat/elem/cl_FF_zerop.cc

@ -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

2
src/float/ffloat/input/cl_FF_from_string.cc

@ -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)

8
src/float/ffloat/misc/cl_FF_as.cc

@ -13,18 +13,18 @@
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)

2
src/float/input/cl_F_from_string.cc

@ -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)

10
src/float/input/cl_F_read.cc

@ -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)

10
src/float/input/cl_F_read_stream.cc

@ -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;
}
}

2
src/float/lfloat/algebraic/cl_LF_sqrt.cc

@ -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

2
src/float/lfloat/elem/cl_LF_I_div.cc

@ -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;

2
src/float/lfloat/elem/cl_LF_I_mul.cc

@ -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;

2
src/float/lfloat/elem/cl_LF_from_I.cc

@ -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;

4
src/float/lfloat/elem/cl_LF_minusp.cc

@ -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

8
src/float/lfloat/elem/cl_LF_plusp.cc

@ -20,14 +20,14 @@
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

4
src/float/lfloat/elem/cl_LF_zerop.cc

@ -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

2
src/float/lfloat/input/cl_LF_from_string.cc

@ -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)

6
src/float/lfloat/misc/cl_LF_as.cc

@ -13,12 +13,12 @@
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)

8
src/float/misc/cl_F_as.cc

@ -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)

4
src/float/output/cl_F_dprint.cc

@ -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;
}

2
src/float/sfloat/elem/cl_SF_from_I.cc

@ -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).

4
src/float/sfloat/elem/cl_SF_minusp.cc

@ -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

8
src/float/sfloat/elem/cl_SF_plusp.cc

@ -19,14 +19,14 @@
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

4
src/float/sfloat/elem/cl_SF_zerop.cc

@ -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

2
src/float/sfloat/input/cl_SF_from_string.cc

@ -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)

6
src/float/sfloat/misc/cl_SF_as.cc

@ -13,12 +13,12 @@
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)

4
src/float/transcendental/cl_F_atanx.cc

@ -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)

4
src/float/transcendental/cl_F_expx.cc

@ -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;
}

4
src/float/transcendental/cl_F_lnx.cc

@ -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)

4
src/float/transcendental/cl_LF_coshsinh.cc

@ -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;
}

4
src/float/transcendental/cl_LF_cossin.cc

@ -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;
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save