(48G) GCD: Greatest Common Divisor
|
09-01-2018, 06:46 PM
(This post was last modified: 09-01-2018 06:51 PM by DavidM.)
Post: #15
|
|||
|
|||
RE: (48G) GCD: Greatest Common Divisor
(09-01-2018 05:05 PM)Thomas Klemm Wrote: Can somebody explain how the size of these programs are determined? The reason this is larger is due to the way that the internal UserRPL compiler adds an empty "secondary" in between the REPEAT and the END. The empty secondary is comprised of the two SysRPL primitives :: and ;. Each one uses 2.5 bytes, for a total of 5 bytes which are "invisible" in the text form of the source code. Something has to exist after the REPEAT and before the END for the RPL stream to be processed correctly. (09-01-2018 05:05 PM)Thomas Klemm Wrote: Whereas this longer program uses only 20 bytes: This one is compiled as you would probably expect, with the SWAP command between the REPEAT and END. SWAP only takes 2.5 bytes (compared to the 5 above), hence the smaller size of the total program. For completeness, here's the SysRPL representations of both programs after the RPL compiler is done with them: Code:
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)