lvar counting some constants as variables

Bugs

Modérateur : xcasadmin

lukamar
Messages : 294
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

lvar counting some constants as variables

Message par lukamar » dim. sept. 10, 2017 4:08 pm

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

parisse
Messages : 5082
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: lvar counting some constants as variables

Message par parisse » lun. sept. 11, 2017 12:42 pm

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.

Répondre