Post Reply 
(49G) Integer Square Detection
10-13-2015, 07:04 AM
Post: #5
RE: HP 49G: Integer Square Detection
And here a slightly optimized version of ISSQ?

Code:

::
   CK1&Dispatch
   # FF
   ::
     ::
       DUP1LAMBIND
       TRUE
       NIBHEX 4162090000B320
       ZINT 11
       NIBHEX 4162071000316410668910A81210
       ZINT 65
       NIBHEX 41620510003920542103842040
       ZINT 63
       NIBHEX 41620510003120302021202020
       ZINT 64
       BINT5
       ONE_DO
       ::
         1GETLAMSWAP_
         FPTR2 ^ZMod
         FPTR2 ^Z>#
         FPTR2 ^ZBit?
         SWAPDROP
         ?SEMI
         ISTOP-INDEX
         #2*
         #1-
         NDROP
         FALSE
         ExitAtLOOP
       ;
       LOOP
       ABND
       NOTcsdrpfls
       DUP
       Z2_
       Z<
       casedrptru
       DUP
       FPTR2 ^Z>ZH
       FPTR2 ^ZBits
       BINT2
       #/
       #+
       Z2_
       SWAP
       FPTR2 ^PPow#
       BEGIN
       SWAPDROPDUP
       3PICKOVER
       FPTR2 ^ZQUOText
       FPTR2 ^QAdd
       Z2_
       FPTR2 ^ZQUOText
       2DUP
       Z>
       NOT_UNTIL
       DROP
       FPTR2 ^ZSQ_
       EQUAL
     ;
     COERCEFLAG
   ;
 ;
@
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(49G) Integer Square Detection - Gerald H - 10-11-2015, 06:48 AM
RE: HP 49G: Integer Square Detection - Gerald H - 10-13-2015 07:04 AM



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