* of special functions or implement the interface to the bignum package. */
/*
- * GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2002 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
} else {
if (cln::zerop(r)) {
// case 2, imaginary: y*I or -y*I
- if ((precedence() <= level) && (i < 0)) {
- if (i == -1) {
- c.s << par_open+imag_sym+par_close;
- } else {
+ if (i==1)
+ c.s << imag_sym;
+ else {
+ if (precedence()<=level)
c.s << par_open;
+ if (i == -1)
+ c.s << "-" << imag_sym;
+ else {
print_real_number(c, i);
- c.s << mul_sym+imag_sym+par_close;
- }
- } else {
- if (i == 1) {
- c.s << imag_sym;
- } else {
- if (i == -1) {
- c.s << "-" << imag_sym;
- } else {
- print_real_number(c, i);
- c.s << mul_sym+imag_sym;
- }
+ c.s << mul_sym+imag_sym;
}
+ if (precedence()<=level)
+ c.s << par_close;
}
} else {
// case 3, complex: x+y*I or x-y*I or -x+y*I or -x-y*I
return false;
}
+int numeric::degree(const ex & s) const
+{
+ return 0;
+}
+
+int numeric::ldegree(const ex & s) const
+{
+ return 0;
+}
+
+ex numeric::coeff(const ex & s, int n) const
+{
+ return n==0 ? *this : _ex0;
+}
+
/** Disassemble real part and imaginary part to scan for the occurrence of a
* single number. Also handles the imaginary unit. It ignores the sign on
* both this and the argument, which may lead to what might appear as funny