* Implementation of GiNaC's initially known functions. */
/*
- * GiNaC Copyright (C) 1999-2005 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2008 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
if (y.is_integer()) {
if (y.is_nonneg_integer()) {
const unsigned N = y.to_int();
- if (N == 0) return _ex0;
+ if (N == 0) return _ex1;
if (N == 1) return x;
ex t = x.expand();
for (unsigned i = 2; i <= N; ++i)
// syntax checks
if (!eqns.info(info_flags::list)) {
- throw(std::invalid_argument("lsolve(): 1st argument must be a list"));
+ throw(std::invalid_argument("lsolve(): 1st argument must be a list or an equation"));
}
for (size_t i=0; i<eqns.nops(); i++) {
if (!eqns.op(i).info(info_flags::relation_equal)) {
}
}
if (!symbols.info(info_flags::list)) {
- throw(std::invalid_argument("lsolve(): 2nd argument must be a list"));
+ throw(std::invalid_argument("lsolve(): 2nd argument must be a list or a symbol"));
}
for (size_t i=0; i<symbols.nops(); i++) {
if (!symbols.op(i).info(info_flags::symbol)) {