Post Reply 
ifactor(Ans) does not work
08-05-2015, 12:59 PM
Post: #1
ifactor(Ans) does not work
Hello !

I try to do a factorisation on the result of a previous calculation.
Example: I calculate 78*9 and then try to factorise the result with ifactor.
I receive an error message:
"ifactor(Ans) Error: Bad Argument Value"

See attachment.

Same error both on emulator and real Prime.

Does anyone else have the same problem?
Thank you for the help

Reto


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
08-05-2015, 01:21 PM
Post: #2
RE: ifactor(Ans) does not work
Hm, first I thought: that is a cas-command, I tried in cas-mode and your example worked, I tried in Home, chose Ifactor from the Menu, that provided: CAS.ifactor(Ans) and it worked, too, the last try was, in Home, ifactor from the catalog, it also worked. Perhaps you haven't updated to the latest version.
Arno
Find all posts by this user
Quote this message in a reply
08-05-2015, 01:28 PM
Post: #3
RE: ifactor(Ans) does not work
Hello Arno

I have SW Ver: 2015 6 17 (8151)
HW Ver: C

You are right about CAS, in CAS mode it works.
The problem seems to be only in Home, but ifactor(702) works fine also in Home.

Reto
Find all posts by this user
Quote this message in a reply
08-05-2015, 01:59 PM (This post was last modified: 08-05-2015 02:12 PM by Didier Lachieze.)
Post: #4
RE: ifactor(Ans) does not work
This comes from the fact that there are two different Ans: one for Home and one for CAS, and CAS functions use the CAS Ans even when called in Home.
More details here.
Find all posts by this user
Quote this message in a reply
08-05-2015, 02:15 PM (This post was last modified: 08-05-2015 02:19 PM by Marcelo Vanti.)
Post: #5
RE: ifactor(Ans) does not work
Hello!
Yes, if I do CAS.ifactor(Ans) the answer I get is 1! Otherwise, CAS.ifactor(702) gives 2*3^3*13. Same in RPN mode.

Marcelo
Find all posts by this user
Quote this message in a reply
08-05-2015, 02:54 PM
Post: #6
RE: ifactor(Ans) does not work
If you put 78*9 [Enter] in the CAS command line first, then switch back to HOME you can see the CAS Ans is used:

[CAS] 78*9 ==> 702
[HOME] ifactor(Ans)) ==> 2*3^3*3
Find all posts by this user
Quote this message in a reply
08-05-2015, 03:08 PM
Post: #7
RE: ifactor(Ans) does not work
Thank you very much to all,

I did not think about the 2 different Ans (Home and Cas).
So as I tried I probably had a value in the Cas Ans that could not be passed to the ifactor function and that caused the error.

I find this a bit confusing. If I calculate 3*5 in Cas then go back to home calculate 3*7 and then I do ifactor(Ans) I find 3*5. This is the right answer because it is the factorisation of 15, the last Cas result, and not of 21, the last Home result.

Quite odd... I can understand that this is right, but if you don't notice you are using a Cas function in home (if you take it from catalog you don't see the CAS.-) you go up with an answer that is not the one you are looking for...

Reto
Find all posts by this user
Quote this message in a reply
08-05-2015, 04:02 PM
Post: #8
RE: ifactor(Ans) does not work
A very instructive thread.

The lesson I learn: Don't use the Prime to do a calculation, it's just too complicated.
Find all posts by this user
Quote this message in a reply
08-05-2015, 04:07 PM
Post: #9
RE: ifactor(Ans) does not work
I think the easier way to get round it is using RPN, i.e,
78 9 * Enter
CAS.ifactor (1) ==> 2*3^3*13

Marcelo
Find all posts by this user
Quote this message in a reply
08-05-2015, 06:12 PM
Post: #10
RE: ifactor(Ans) does not work
(08-05-2015 04:07 PM)Marcelo Vanti Wrote:  I think the easier way to get round it is using RPN, i.e,
78 9 * Enter
CAS.ifactor (1) ==> 2*3^3*13

Yes it works, but the RPN of the Prime is not really a "true RPN". In RPN you would not need to specify the (1) as an argument.
You can obtain the same result in Textbook mode using "up arrow" Enter, so you copy the last result as argument for the ifactor() function.

Reto
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)