Post Reply 
HP 50G help
08-06-2016, 07:23 PM (This post was last modified: 08-06-2016 07:25 PM by Claudio L..)
Post: #46
RE: HP 50G help
(08-06-2016 12:11 PM)Hlib Wrote:  I had to ensure a proper understanding of my operation correctly with HP-50g, if I type 5 3 / EXE or <<5 3 />> EVAL, the calculator returns the result of 5/3, because the system flag -105 = 0 (exact mode) only works in manual mode. The program returns to me, for example, for << 105 SF 5 3 / >> or for <<105 CF 5 3 />> 1.6666 ... or sometimes 5/3 no matter if the user flag 105 = 1 or =0. The program returns 5/3 or 1.666 ... arbitrarily regardless of the system/user flags. I threw one of my HP-50g and bought another. But the problem persists. Rev 2.15.
Claudio, you have a special HP-50g calculator?

There's more than flags going on in your example.
When you type a program, pay special attention to the trailing dots in numbers.
<< 5 3 / >> is not the same as << 5. 3. / >>
The compiler will generate one form or the other depending on flag -105 at *compile time*.
In the second form the numbers are reals. The operation on reals will always return 1.6666666... regardless of exact mode. Real numbers are not considered exact, hence you can't get an exact result from inexact numbers, even in exact mode.
In the first form, both numbers are exact, and the division of 2 exact numbers gives you a fraction (exact result) regardless of the mode.
Now EVAL does take the flag into consideration, so once you have '5/3' in the stack, if you do EVAL in exact mode you'll get the same '5/3', but in approx. mode EVAL will produce 1.66666...

It's quirky, the flag works as intended during compile and during EVAL, but once the program was compiled with exact or inexact numbers, the result is determined by the compiled code, regardless of state of the flag when you run the program (unless you use EVAL inside the program, that is...).
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP 50G help - jrmc114064 - 04-23-2015, 04:11 AM
RE: HP 50G help - Gilles - 04-23-2015, 09:09 AM
RE: HP 50G help - jrmc114064 - 04-23-2015, 04:00 PM
RE: HP 50G help - Gilles - 04-25-2015, 12:48 PM
RE: HP 50G help - Marcio - 04-25-2015, 02:23 PM
RE: HP 50G help - Gilles - 04-25-2015, 02:38 PM
RE: HP 50G help - Marcio - 04-25-2015, 02:46 PM
RE: HP 50G help - Sukiari - 04-27-2015, 10:05 PM
RE: HP 50G help - Marcio - 04-27-2015, 10:13 PM
RE: HP 50G help - jrmc114064 - 04-23-2015, 04:08 PM
RE: HP 50G help - Tugdual - 04-23-2015, 09:08 PM
RE: HP 50G help - peacecalc - 04-23-2015, 10:23 PM
RE: HP 50G help - Tugdual - 04-24-2015, 07:16 AM
RE: HP 50G help - Marcus von Cube - 04-24-2015, 08:41 AM
RE: HP 50G help - Tugdual - 04-24-2015, 10:21 AM
RE: HP 50G help - Marcus von Cube - 04-24-2015, 11:08 AM
RE: HP 50G help - Tugdual - 04-24-2015, 11:52 AM
RE: HP 50G help - DavidM - 04-24-2015, 04:23 PM
RE: HP 50G help - Tugdual - 04-24-2015, 05:19 PM
RE: HP 50G help - Han - 04-24-2015, 05:32 PM
RE: HP 50G help - rprosperi - 04-24-2015, 05:33 PM
RE: HP 50G help - DavidM - 04-24-2015, 07:34 PM
RE: HP 50G help - Tugdual - 04-24-2015, 10:25 PM
RE: HP 50G help - Sukiari - 04-25-2015, 02:42 PM
RE: HP 50G help - Sukiari - 04-25-2015, 02:37 PM
RE: HP 50G help - Marcio - 04-24-2015, 01:25 AM
RE: HP 50G help - Hlib - 06-08-2015, 08:46 PM
RE: HP 50G help - Hlib - 07-23-2015, 04:26 PM
RE: HP 50G help - DavidM - 07-23-2015, 06:15 PM
RE: HP 50G help - rprosperi - 07-23-2015, 09:32 PM
RE: HP 50G help - Hlib - 07-23-2015, 10:18 PM
RE: HP 50G help - Brad Barton - 07-23-2015, 11:17 PM
RE: HP 50G help - rprosperi - 07-24-2015, 01:30 AM
RE: HP 50G help - Hlib - 07-23-2015, 08:40 PM
RE: HP 50G help - Hlib - 07-24-2015, 09:21 AM
RE: HP 50G help - Hlib - 08-14-2015, 04:25 PM
RE: HP 50G help - Claudio L. - 08-14-2015, 09:28 PM
RE: HP 50G help - Hlib - 03-17-2016, 06:22 PM
RE: HP 50G help - ttw - 03-17-2016, 10:41 PM
RE: HP 50G help - Hlib - 08-06-2016, 02:47 PM
RE: HP 50G help - Hlib - 08-05-2016, 02:44 PM
RE: HP 50G help - Claudio L. - 08-05-2016, 04:31 PM
RE: HP 50G help - Hlib - 08-06-2016, 12:11 PM
RE: HP 50G help - Vtile - 08-06-2016, 03:26 PM
RE: HP 50G help - Massimo Gnerucci - 08-06-2016, 03:29 PM
RE: HP 50G help - Claudio L. - 08-06-2016 07:23 PM
RE: HP 50G help - Claudio L. - 08-06-2016, 07:30 PM
RE: HP 50G help - Hlib - 08-06-2016, 08:05 PM
RE: HP 50G help - DavidM - 08-06-2016, 09:31 PM
RE: HP 50G help - Joe Horn - 08-07-2016, 10:59 PM
RE: HP 50G help - DavidM - 08-08-2016, 02:41 AM
RE: HP 50G help - rprosperi - 08-09-2016, 11:32 PM
RE: HP 50G help - DavidM - 08-10-2016, 01:44 AM
RE: HP 50G help - Vtile - 08-08-2016, 01:25 AM
RE: HP 50G help - Joe Horn - 08-08-2016, 12:17 PM



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