ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 09 Dec 2017 00:45:51 +0100Why is a==b False?https://ask.sagemath.org/question/40024/why-is-ab-false/Please see the following code. Why is a==b False? Thanks!
Input:
a=n(1/2*sqrt(5) - 1/2,digits=15)
b=n(1-a^2,digits=15)
print a
print b
a==b
Output:
0.618033988749895
0.618033988749895
FalseKapcakSat, 09 Dec 2017 00:45:51 +0100https://ask.sagemath.org/question/40024/Solve contains wrong solutionhttps://ask.sagemath.org/question/9597/solve-contains-wrong-solution/Hello, I tried to following to find a maxima of a function:
var('t x');
f=(e^(x*t))*(x-1)^2;
maxima = solve([derivative(f,x)==0, derivative(f,x,2)<0],x)
show(maxima);
And the solution sage spits out are:
[
[x == 1, -2 > 0],
[x == (t - 2)/t, -(t - 2)^2 + 2*(t - 2)*t - t^2 + 6 > 0]
]
I understand that sage cannot evaluate the validity of the second solution but the first one surely is no solution at all.
Why does it give me this solution or am I doing anything wrong?mawekiSat, 01 Dec 2012 22:14:02 +0100https://ask.sagemath.org/question/9597/