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.Sun, 05 Aug 2012 07:30:48 +0200Maple versus Sage, porting issueshttps://ask.sagemath.org/question/9210/maple-versus-sage-porting-issues/Consider the expression
if (m == 3) or (m == -3) : print n, m
Could a simple minded programmer ever expect to see an output
different from n, 3 or n, -3 for some n?
No, because it is /verboten/ by logic that m can have a
different value from 3 or -3!
Let's check it nevertheless with Maple:
for n from 0 to 50 do
m := n mod 8:
if (m = 3) or (m = -3) then print(n, m) fi od:
3, 3
11, 3
19, 3
27, 3
35, 3
43, 3
And now the same with Sage.
for n in (0..50):
m = mod(n, 8)
if (m == 3) or (m == -3) : print n, m
3 3
5 5
11 3
13 5
19 3
21 5
27 3
29 5
35 3
37 5
43 3
45 5
How many simple minded Maple programmers have broken their necks with such alike?
Could someone please point to a page in the Sage documentation where this is explained and due warnings are given, if such a page exists?
petropolisSun, 05 Aug 2012 07:30:48 +0200https://ask.sagemath.org/question/9210/