The Museum of HP Calculators

HP Forum Archive 19

[ Return to Index | Top of Index ]

HPAPINE
Message #1 Posted by Jan Kromhout on 5 Sept 2009, 3:11 a.m.

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 Hellevoetsluis-NL

      
Re: HPAPINE
Message #2 Posted by Khanh-Dang Nguyen Thu-Lam on 5 Sept 2009, 12:30 p.m.,
in response to message #1 by 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.

            
Re: HPAPINE
Message #3 Posted by Jan Kromhout on 7 Sept 2009, 12:21 a.m.,
in response to message #2 by Khanh-Dang Nguyen Thu-Lam

Thanks for the information.

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

Thanks in advance.

Jan Kromhout Hellevoetsluis-nl

                  
Re: HPAPINE
Message #4 Posted by Egan Ford on 7 Sept 2009, 9:59 a.m.,
in response to message #3 by 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.

                  
Re: HPAPINE
Message #5 Posted by Khanh-Dang Nguyen Thu-Lam on 7 Sept 2009, 10:00 a.m.,
in response to message #3 by Jan Kromhout

Just take a look at the Makefiles, then, just run the make command. http://en.wikipedia.org/wiki/Makefile

                        
Re: HPAPINE
Message #6 Posted by Jan Kromhout on 7 Sept 2009, 4:27 p.m.,
in response to message #5 by Khanh-Dang Nguyen Thu-Lam

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... 100 500 --- 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 Hellevoetsluis-NL

                              
Re: HPAPINE
Message #7 Posted by Khanh-Dang Nguyen Thu-Lam on 8 Sept 2009, 4:30 a.m.,
in response to message #6 by Jan Kromhout

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

                                    
Re: HPAPINE
Message #8 Posted by Jan Kromhout on 8 Sept 2009, 7:17 a.m.,
in response to message #7 by Khanh-Dang Nguyen Thu-Lam

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 Hellevoetsluis-NL


[ Return to Index | Top of Index ]

Go back to the main exhibit hall