Page 1 sur 1

lvar counting some constants as variables

Publié : dim. sept. 10, 2017 4:08 pm
par lukamar
Hi!

The output from 'lvar' may sometimes be counterintuitive (or there is simply a bug). For example, the command

Code : Tout sélectionner

lvar(expexpand(exp(x+1)))
returns [exp(x),exp(1)]. According to the help index, 'lvar' returns a list of variables with rational dependence, but the second element is a real constant...

Re: lvar counting some constants as variables

Publié : lun. sept. 11, 2017 12:42 pm
par parisse
Yes, but this is still a generalized variable, I mean it behaves like a normal variable if you want to make polynomial or rational exact operations on an expression.
You can run evalf on the output of lvar and lvar again to avoid this.