Browse Source

* src/complex/transcendental/cl_C_expt_C.cc (expt): fix logic for

the 0^y cases.
        * inserted the missing ChangLog entry.  :-)
master
Richard Kreckel 25 years ago
parent
commit
ddf99dafef
  1. 43
      ChangeLog
  2. 34
      src/complex/transcendental/cl_C_expt_C.cc

43
ChangeLog

@ -1,3 +1,8 @@
2000-09-05 Richard Kreckel <kreckel@ginac.de>
* src/complex/transcendental/cl_C_expt_C.cc (expt): fix logic for
the 0^y cases.
2000-08-30 Richard Kreckel <kreckel@ginac.de>
* include/cln/number.h, cl_number::_as_cl_private_thing(): removed.
@ -11,7 +16,43 @@
2000-08-29 Richard Kreckel <kreckel@ginac.de>
* TODO: DESCRIBE NAMESPACE CHANGES HERE!!!
* */*: Pushed CLN into a namespace `cln'. While doing so, the
following identifiers got their poor-man's namespace (i.e. the
prefix `cl_') stripped off:
cl_catalanconst() -> catalanconst()
cl_compare() -> compare()
cl_cos_sin() -> cos_sin()
cl_cos_sin_t -> cos_sin_t
cl_cosh_sinh() -> cosh_sinh()
cl_cosh_sinh_t -> cosh_sinh_t
cl_decoded_dfloat -> decoded_dfloat
cl_decoded_ffloat -> decoded_ffloat
cl_decoded_float -> decoded_float
cl_decoded_lfloat -> decoded_lfloat
cl_decoded_sfloat -> decoded_sfloat
cl_default_float_format -> default_float_format
cl_default_print_flags -> default_print_flags
cl_default_random_state -> default_random_state
cl_double_approx() -> double_approx()
cl_equal() -> equal()
cl_equal_hashcode() -> equal_hashcode()
cl_eulerconst() -> eulerconst()
cl_find_modint_ring() -> find_modint_ring()
cl_find_univpoly_ring() -> find_univ_poly_ring()
cl_float_approx() -> float_approx
cl_float_format() -> float_format()
cl_float_format_t -> float_format_t
cl_free_hook() -> free_hook()
cl_hermite() -> hermite()
cl_laguerre() -> laguerre()
cl_legendre() -> legandre()
cl_malloc_hook() -> malloc_hook()
cl_pi() -> pi()
cl_tschebychev() -> tschebychev()
cl_zeta() -> zeta()
NB: For functions these changes includes all signatures.
* include/*: moved to include/cln/*, stripped `cl_' off filenames.
* cln-config.in: new file.
2000-08-26 Bruno Haible <haible@clisp.cons.org>

34
src/complex/transcendental/cl_C_expt_C.cc

@ -6,7 +6,6 @@
// Specification.
#include "cln/complex.h"
// Implementation.
#include "cl_C.h"
@ -180,17 +179,13 @@ const cl_N expt (const cl_N& x, const cl_N& y)
}
// allgemeiner Fall (z.B. y Float oder komplex):
if (zerop(x)) { // x=0.0 ?
if (zerop(y)) // y=0.0?
return expt_0(x); // Liefere 1
if (rationalp(realpart(y))) // Realteil von y >0 exakt.
return 0;
if (!plusp(realpart(y))) // Realteil von y <=0 ?
{ cl_error_division_by_0(); }
if (realp(x) && realp(y)) {
DeclareType(cl_R,x);
DeclareType(cl_R,y);
var cl_R f = contagion(x,y);
// ein Float, da sonst x = Fixnum 0 gewesen wäre
{ DeclareType(cl_F,f);
return cl_float(0,f); // 0.0
}
} else {
cl_error_division_by_0();
else {
var cl_R f = contagion(contagion(x),contagion(y));
// ein Float, da sonst x = Fixnum 0 gewesen wäre
{ DeclareType(cl_F,f);
@ -199,23 +194,6 @@ const cl_N expt (const cl_N& x, const cl_N& y)
}
}
}
if (zerop(y)) { // y=0.0 ?
if (realp(x) && realp(y)) {
DeclareType(cl_R,x);
DeclareType(cl_R,y);
var cl_R f = contagion(x,y);
// ein Float, da sonst y = Fixnum 0 gewesen wäre
{ DeclareType(cl_F,f);
return cl_float(1,f);
}
} else {
var cl_R f = contagion(contagion(x),contagion(y));
// ein Float, da sonst y = Fixnum 0 gewesen wäre
{ DeclareType(cl_F,f);
return complex_C(cl_float(1,f),cl_float(0,f));
}
}
}
return exp(log(x)*y);
}

Loading…
Cancel
Save