Unless I am misunderstanding something, 2.5.alpha0 seems to have some problems with equality testing. A typical example is
sage: bool(sqrt(2) == 1) False sage: bool(sqrt(2) != 1) False However, the following does work correctly: sage: bool(sqrt(2) < 1) False sage: bool(sqrt(2) > 1) True This seems to show up with all symbolic expression whatchamacallits. Other examples are sage: bool(exp(1) != 1) False sage: bool(sin(1) != 1) False sage: bool(cos(1) != 1) False sage: bool(log(2) != 1) False sage: bool(sin(1) != sin(2)) False even though sage gets the comparisons sage: bool(exp(1) > 1) True sage: bool(sin(1) < 1) True sage: bool(cos(1) < 1) True sage: bool(log(2) < 1) True sage: bool(sin(1) < sin(2)) True correct. Sage does sometimes get the right answer when it can simplify to get "simple" types. For example, sage knows that sage: bool(log(1) != 1) True presumably because it simplifies to get log(1) = 0. However, the following is also incorrect sage: bool(exp(0) != 0) False even though we have sage: exp(0) 1 sage: bool(exp(0) == 1) True Finally, other interesting examples are sage: bool(cos(0) == 1) True sage: bool(cos(0) != 1) True sage: bool(exp(0) == 1) True sage: bool(exp(0) != 1) True Also, I have noticed that the log function does not have the same type as other functions - sage: type(log) <type 'function'> sage: type(exp) <class 'sage.calculus.calculus.Function_exp'> This might explain why equality testing is a little different with log than with the other functions, but it might not, given that log(1) and exp(0) have the same type. Also, by the way, I really like the new sage.calculus stuff. -Jon Bober --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---