Dear All,

Is it posible to format the stack output (RPL Stack) when using HPAPINE?

I wont to have the maximal digits after the decimal point!

Thanks in advance
Jan Kromhout


HPAPINE is released under the GNU Public License. It means you can read and modify the source code.

To change the printing format, go in the HPAPINE's source root directory and edit the src/saturn/rplapi.c file. In the SAT_DOREAL case, change the format string "%g" in the fprintf() instruction with "%.16f" or whatever you want.

However, HPAPINE is not a emulator. It is an implementation of the HPGCC's standard libraries. You should not expect the math functions of HPAPINE to give the exact same result than with HPGCC.


Thanks for the information.

Is there some help how to compile a new version with the change yoe mentiod?

Thanks in advance.

Jan Kromhout


If you are using the http://sense.net/~egan/hpgcc versions, then you should just have to type 'make' in the 2.0SP2-hpapine directory.


Just take a look at the Makefiles, then, just run the make command.


Thanks for all usefull information.
I have changed the code as you mentiod, but in HPAPINE output I see :

--- Waiting for stack input on stdin...
--- Stack reading: done.

--- RPL Stack:

2: 100.0000000000000000
1: 500.0000000000000000

--- RPL Stack:

1: " 3375.06"

How (where) can I change the output so that I see more decimals.

Thanks inadvance.

Jan Kromhout


What is your program doing? What HPGCC routines does it use? What does a real HP49G+ or HP50g return?


I use a routine as mentiod "SAT_DOREAL"

My program is taken two values from sthe stack (pressure and temperature) and calculates the enthalpy of steam.
In normal operation on the hp50g I set in mode the max alowed decimal positions.

In the output of HPAPINE I wont to have the same behavior, max amount of decimal positions on the anwer.

On my hp50 the anwer is 3375.05844185

Thanks in advance

Jan Kromhout

Possibly Related Threads...
Thread Author Replies Views Last Post
  HPAPINE Jan Kromhout 3 1,101 09-07-2009, 03:41 PM
Last Post: Egan Ford
  Error message in Hpapine, HPGCC,XP Jan Kromhout 2 859 08-30-2009, 11:53 AM
Last Post: Jan Kromhout

Forum Jump: