Post Reply 
(12C) Check if two numbers is to the power of other
09-07-2018, 03:21 PM (This post was last modified: 09-07-2018 03:22 PM by rprosperi.)
Post: #10
RE: (12C) Check if two numbers is to the power of other
Update: Found the problem, and it's weird. (Gamo posted while writing this, seems he's found the same thing)

Using input: 5 [Enter] 25 [R/S] (or in this case using SST):

On the 2nd pass through steps 9-17, upon hitting the test in line 17, the stack is:

T: 25
Z: 1
Y: 25
X: 25

On a real 12CP, the test (X<=Y) is true, so execution continues on line 18.

On the Android 12CP, the test (X<=Y) fails, and execution continues on line 19 <==== [ERROR].

First thought was perhaps it really tests (X<Y) only and ignores the [=] part, but a simple test program reveals this is not the case:

Code:
001 X<=Y
002 GTO 005
003 0
004 GTO 006
005 1
006 GTO 000

works right every time.

So, somehow there is an internal issue causing the [X<=Y] test to produce improper results upon multiple passes of a program loop.

A few more test cases however show the problem does not always occur:

3, 9 => 0 [ERROR]
5, 625 => 0 [ERROR]
4,16 => 0 [ERROR]

but

2, 4 => 1 [Correct]

Could someone else with the Android emulator please verify these results before reporting it to HP?

12CP Emulator version: 1.7.1, Mar 23, 2017

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (12C) Check if two numbers is to the power of other - rprosperi - 09-07-2018 03:21 PM



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