On 6 December 2010 19:43, David Kirkby <[email protected]> wrote:
> On 6 December 2010 19:33, Mike Hansen <[email protected]> wrote:
>>> Here's the same sort of thing in Mathematica.
>>>
>>> In[3]:= 12 == 2
>>>
>>> Out[3]= False
>>>
>>> In[4]:= 1 == 1
>>>
>>> Out[4]= True
>>>
>>> In[5]:= AcrSin[x] == 2 ArcTan[x/(1+Sqrt[1+x^2])]
>>>
>>>                                     x
>>> Out[5]= AcrSin[x] == 2 ArcTan[----------------]
>>>                                            2
>>>                              1 + Sqrt[1 + x ]
>>>
>>>
>>> In[7]:= x^3 == x x^2
>>>
>>> Out[7]= True
>>>
>>> As you can see, when Mathematica does not know if the expression is
>>> true or false, it returns the expression, not "True" or "False".
>>
>> Here's the same thing in Sage:
>>
>> sage: 12 == 2
>> False
>> sage: 1 == 1
>> True
>> sage: arcsin(x) == 2*arctan(x/(1+sqrt(1-x^2)))
>> arcsin(x) == 2*arctan(x/(sqrt(-x^2 + 1) + 1))
>> sage: x^3 == x*x^2
>> x^3 == x^3
>>
>> As you see, Sage does the exact same thing; although, it doesn't even
>> try to determine if x^3 is equal x^3.  But, the user is _explicitly_
>> asking to return either a True or False value -- that's what "bool"
>> does in Python.
>>
>> --Mike
>
> Oh, I missed that - it is similar, but not identical to Mathematica's
> TrueQ[]. Again, I personally prefer the MMA behavior.
>
> In[9]:= ?TrueQ
> TrueQ[expr] yields True if expr is True, and yields False otherwise.
>
> In[10]:= True[ AcrSin[x] == 2 ArcTan[x/(1+Sqrt[1+x^2])]]

Oops, I put in "True" not "TrueQ"

Mathematica then behaves the same as Sage

In[1]:= TrueQ[AcrSin[x] == 2 ArcTan[x/(1+Sqrt[1+x^2])]]



Dave

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to