Post Reply 
50g. Substitution of the FACTORS command
09-10-2017, 10:21 AM (This post was last modified: 09-10-2017 10:45 AM by Gilles59.)
Post: #2
RE: 50g. Substitution of the FACTORS command
(09-10-2017 10:02 AM)pier4r Wrote:  I do not really like to use the built in command FACTORS when I would like to know the factors of a integer number in real format. FACTORS would require some flags to be set plus real to integer conversion.

Hi Pier...
Another way :

Code:
My new Factors command :
«
 PUSH   @ save system flags
  DUP 
   RAD -3 CF  R->I  FACTORS 
  SWAP TYPE NOT { I->R } IFT
 POP @ Restaure system flags
»

If i'm not wrong it's OK with your requirements:
input: an integer or an integer in real form (so with the dot at the end), flag -3 and -105 set or unset, does not matter.
output: the factors of the input number (integers in real or integer form)
No change of the flags setup and angle mode
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: 50g. Substitution of the FACTORS command - Gilles59 - 09-10-2017 10:21 AM



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