Actually, that's not quite true. SymPy has its own boolean types, and
x ^ x gives the SymPy BooleanFalse (S.false). The derivative of this
is 0 not because it interprets it as a numeric 0 but because it
doesn't depend on x, and diff automatically knows that the derivative
of any expression that
Am 31.05.2015 um 22:50 schrieb Aaron Meurer:
Perhaps we should make derivatives of booleans give TypeError. That
would make it much easier to see what is going on.
+1
Similarly, integer-valued functions should (probably?) emit a warning if
a derivative is taken. The derivative is technically
I also vote for the TypeError.
Le 31 mai 2015 23:17, Joachim Durchholz j...@durchholz.org a écrit :
Am 31.05.2015 um 22:50 schrieb Aaron Meurer:
Perhaps we should make derivatives of booleans give TypeError. That
would make it much easier to see what is going on.
+1
Similarly,
And because *x^x* means *x xor x* which numeric value is *0* or *1*
so the derivative is equal to zero.
*Christophe BAL*
*Enseignant de mathématiques en Lycée **et développeur Python amateur*
*---*
*French math teacher in a Lycée **and **Python **amateur developer*
--
You received this
In [1]: x^x
Out[1]: False
In [2]: diff(False, x)
Out[2]: 0
You should use instead of *^* if you'd like to represent
exponentiation. The symbol ^ stands for XOR.
On Friday, 29 May 2015 23:17:11 UTC+2, Oscar wrote:
On 29 May 2015 22:06, Thomas Leitz unruh...@gmail.com javascript:
Hi,
the online shell at http://live.sympy.org/ tells me
diff(x^x,x) = 0
Why is that?
Tom
--
You received this message because you are subscribed to the Google Groups
sympy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
On 29 May 2015 22:06, Thomas Leitz unruhsc...@gmail.com wrote:
Hi,
the online shell at http://live.sympy.org/ tells me
diff(x^x,x) = 0
Why is that?
^ doesn't do what you're expecting in Python. Use ** for exponentiation.
--
Oscar
--
You received this message because you are subscribed