[BUG] When Textbook display is off, == is displayed as = and weird conversions - Printable Version +- HP Forums ( https://www.hpmuseum.org/forum)+-- Forum: HP Calculators (and very old HP Computers) ( /forum-3.html)+--- Forum: HP Prime ( /forum-5.html)+--- Thread: [BUG] When Textbook display is off, == is displayed as = and weird conversions ( /thread-877.html) |

[BUG] When Textbook display is off, == is displayed as = and weird conversions - Stefan - 03-10-2014 05:10 PM
I am not sure whether this is a bug. At least its confusing: I stumbled about it when I defined a CAS function: Code: `phi:=(n)->sum(seq(IF gcd(k,n)==1 THEN 1; ELSE 0; END),k,1,n)` So the first confusion: The "==" which is written in the input is converted to "=" in the history if Textbook display is off (2nd page of Home settings). I remember this thread where Parisse mentions that == should not be used to compare expressions. But since gcd() just returns a number here I guess it should be okay here. Other confusions: Other modifications are also somewhat confusing (letting away the ELSE part): Code: `phi:=(n)->sum(seq(IF (gcd(k,n))=1 THEN 1; END),k,1,n)` From now on Textbook display is switched on: Then the history look as follows: Code: `phi:=(n)->sum(seq(ifte([gcd(k,n)==1 1 0]),k,1,n)` So the IF THEN... gets changed to ifte(). But confusion doesn't end here. After I discovered the handy "ifte()" command because of the previously mentioned output I modified my input as follows: Code: `phi:=(n)->sum(seq(ifte(gcd(k,n)==1, 1, 0),k,1,n))` Which then leads to an output: Code: `phi:=(n)->sum(seq(when(gcd(k,n)==1, 0),k,1,n))` Now lets switch of Textbook display again. If you then type the above into the input line, the output is AGAIN different, now using the ternary operator, plus a shitload of brackets! Code: `phi:=(n)->sum(seq(((((gcd(k,n))==1)) ? 1 : 0),k,1,n))` I am close to say "thank you" to the prime for this nice little tour over all possible variants of conditional clauses :-D. But I'd appreciate if the output would be close to what I typed as input... |