Back Up Next

60.  What are the differences between the HP38G and the HP39G?

Answer (written in 2000):

  1. There is now 256K of memory!  This should allow you to store at least 50 aplets which is wonderful news.  In addition, this will allow you to use the datalogger to full effect - as you know the main problem before was that you could only store about 500 data points.  BTW - are you aware that there is a new datalogger available with extra features, as well as a new datalogger aplet?
  2. The keyboard has been upgraded. Not only does it have a different 'feel', it has more keys available directly. For example, the differentiation and integration operators are now available directly from the keyboard as well as through the MATH menu.
  3. To help you manage the memory, there is a new memory manager view which lists the memory consumed by the various categories of objects (aplets, notes, graphics, lists etc).  Also, each of the category viewers (eg list view) now gives the memory size of the objects it controls.
  4. There is much more logical control of the angle and numeric modes in the 39/40G. In the 38G there were a number of problems. Firstly, because the HOME view was independent of the aplets it meant that if you graphed F1(X)=2SIN(X)-1 in Function (default=radians) and found a root, then evaluating SIN(Root) in HOME (default=degrees) gave the wrong answer. This actually caused people try to return calculators under warantee, assuming that there was something wrong! Secondly, apart from in the Solve aplet, there was no way to set numeric mode for an aplet except via programming.
  5. This has been fixed in the 39/40G by ensuring that angle and numeric mode is controlled in one place only - the MODES view - and that the aplet and the HOME settings *always* match.  In line with this, the SYMB SETUP view has been removed, except for one place - 2VAR mode in the Statistics aplet. If you now set Fixed 4 in MODES and then SHOW a regression line or an equation then it will properly show in Fixed 4 format.
    From the 38G user's point of view this means that they need to be aware now in HOME that changing aplets may cause a change to angle and/or numeric mode settings.  To help users remember this the name of the aplet is now used as a title in the HOME view.  Sadly, this meant that the ability of 38G users to enter their own title had to go. The gain in control more than makes up for this.
    This change also has implications for programmers wanting to upgrade their aplets from the 38G to the 39/40G.
  6. The Statistics aplet now allows you to trace on the regression line.  On the 38G pressing up arrow in PLOT view only moved you from one data set to another.  On the 39/40G pressing up arrow once moves you from you from the data points to the regression line. Tracing on the regression line then gives you PREDY values onscreen. A second up arrow will then move you to the next data set (assuming that there is one).
  7. The Function aplet has been greatly enhanced! The (X,Y) button has been removed (don't panic - read on) and in its place is a GOTO button. This button allows you to jump the cursor directly to any point on the graph, even if it is off screen. This GOTO button is even available in the 'Signed Area...' (formerly 'Area...') function on the FCN button. The functionality of the (X,Y) button has been moved to the MENU button.  The MENU button used to be a double toggle between full menu and no menu.  It is now a triple toggle between full menu, (X,Y) mode and no menu (and back).  Another new feature (long overdue) is that the coordinates are displayed onscreen while tracing to the start and end points for 'Signed area...'. A further REALLY nice feature is that roots and intersections are 'remembered'.  For example, on the 38G if you graph F1(X)=X^2-2 and find the positive root then you get root 2. If you then do an FCN Slope you don't get the slope at root 2 you get the slope at the nearest pixel value to root 2. In the 39/40G this has been fixed. If you do an FCN Slope you will get the slope at root 2.  Similarly, if you find an intersection and then do FCN Signed Area then the default starting point will be that intersection.
  8. Three new aplets have been added to the list of built-in aplets. The Quadratic and Trig Explorer aplets, formerly only available via the web, are now built-in.  Also, a new Inference aplet has been added which allows investigation of confidence intervals and hypothesis testing. This aplet will even import statistical values directly from the Stats aplet!
  9. The 'Autoscale', 'Decimal', 'Integer' and 'Trig' views are now available from the ZOOM button in the PLOT view as well as via the VIEWS button outside PLOT.
  10. A number of bugs have been fixed.  For example, in the 38G if something went wrong in an aplet and the user was asked "Edit program? YES/NO" then answering YES usually resulted in editing the wrong program. This is fixed.  Also, in the Sequence aplet you can enter a sequence which is defined using memory values (eg. U1(1)=A, U1(2)=A*R, U1(N)=U1(N-1)*R) and have it change automatically if the values of A and R are changed in HOME.  There are others but those two spring to mind.
  11. The RelError variable has been added to the list of 2VAR Statistics variables, along with the population covariance. RelError is a measure of the goodness of fit which is independent of the curve used, whereas the correlation coefficient applies only to linear fits.  The closer that RelError is to zero, the better the fit. This variable was always available on the 38G but was not on any menu.  See my FAQ page (question #56) for more information on RelError.
  12. The screen is protected by a clear plastic sheet which should make it less likely to suffer damage.


61.  What are the differences between the hp 39gs and the hp 40gs?

Answer:  The difference between the 39 and the 40 is that the 39 has an infra-red port and the 40 doesn't (the 40 comes with a calc-to-calc cable), while the 40 has a CAS system (Computer Algebra System) and the 39 doesn't. Apart from the obvious differences that the CAS system makes (some special extra functions and differences in the way that answers are presented) the user interface and behaviour are functionally identical. The operating systems are very similar.  Basically Europe wanted CAS but not IR, while the US and Australia (at the time) wanted IR but not CAS. You can never satisfy everyone can you?  Make sure that you don't buy the wrong sort for your particular exam system as you might find yourself in trouble for using an illegal calculator.

Note:  There is no way to turn an hp 39gs into an hp 40gs (and get a CAS) by loading the 40gs operating system into the 39gs flash ROM. Both calculators have flash ROM so that the operating system can be updated if bugs are found. However the amount of ROM on a 40gs is larger than on a 39gs and the operating system for a 40gs simply won't fit into the available space on a 39gs. It's a lot simpler just to buy a 40gs!

62.  What is the 'Library' entry in the MEMORY display of my HP?

Answer:  Most of the aplets that are written for the HP are written using the calculator's built-in programming language.  This language is flexible and easy to use but it is not very fast when it executes because the calculator has to translate it into machine code. If you'd like to know more about it then see the Programming section on my Help page.  When a programmer really wants speed - such as in a game - then they must write the program directly in machine code. This is NOT easy to do but far more flexible and VERY fast.  When an aplet is written this way it is often accompanied by a 'library' containing extra code.  This library is automatically downloaded with the aplet and deleted with it when it is deleted in the APLET view.  When one of your aplets has an attached library then you can view it by pressing the MEMORY button, scrolling down to the Library entry and pressing VIEW.  Generally this view will be empty.  If there is a library there then deleting it will stop the parent aplet from working so it's best to leave the entries alone.

63.  What are these strange new symbols such as  on the keyboard of my HP?

Answer:  Because there were more keys on the keyboard of later models than there were on the original HP38G we were able to fit in a few more functions.  These functions were also present on the HP38G but you had to go through the MATH menu to find them.  Looking at them from the top down & left to right...

Note:  Some of this will not apply to the hp 40gs because of its CAS giving exact answers.

d/dx (appearing as  in the editline):  This is the differentiation operator and is also available from the MATH - Calculus menu.  See the manual, page 10-7.

:  This is the integration operator and is also available from the MATH - Calculus menu.  See the manual, page 10-7 & 10-25.

ABS/ARG:  These operators work with complex numbers or with rectangular to polar conversions and are also available from the MATH - Complex menu.  For a complex number they give the modulus and the arguement.  For rectangular coordinates they give the values of  r and  .  For example,  see right.  Notice the double brackets.  The reason for this is that the function requires brackets:  ABS(....) and so does the coordinate (3,3).

!:  This is the factorial operator and is also available from the MATH - Probability menu.  For example,  5! would give 120.

: This 'angle' operator can be used to convert polar to rectangular coordinates.  For example, if the HOME view is in degree mode then you could convert (r, ) = (2, 30o) to rectangular coordinates as shown right.  There's an interesting variation on the use of this operator which will convert to r cis  format.  In the example shown below right, what was actually entered is not what appears on the screen.  In the first example, I entered (8,45) with the HOME  view in degree mode.  As you can see, what appears in the History is the r cis  form and in rectangular format.  I then changed to radian mode and entered (3,/3).  Again the result was r cis  form and rectangular format.

:  This is the summation operator, also available through the MATH - Loop menu.  The syntax is very similar to the way that a problem is read aloud.  For example, "the sum from j = 1 to 3 of  j 2" would be entered as  (J=1,3,J2) and would give an answer of 14 (12 + 2 2 + 32).

AND:  This is mainly used by the computer algebra system on the 40G and 40gs.  However it also comes in handy when entering domains for graphing functions.  Go back to the FAQ page and check out question #47.

64.  What is the DISPXY command listed in the CMDS menu on the HP?

Answer: From a programmer's point of view, one of the most frustrating things about the HP38G was that there was no way to write a string (of characters) to the graphics screen.  You could use the DISP command but it wipes everything in a band across the screen prior to writing the text you specify and so deletes the very image that you are trying to annotate.  The only other way to do it on the HP38G was very laborious: you had to save a copy of the screen, create a graphic image of the string you wanted to write, superimpose the two and then re-display the image.  This was slow and tedious.

Consequently when I was on the team upgrading the 38G to the 39G/40G, I was very keen to see if we could build a better way of doing this into the new models and I was overjoyed when I managed to persuade the programming team to incorporate the DISPXY command.  The problem was that we did it so late in the process that the manual had already been finalised and so the command didn't make it into the manual for those models. Hence the explanation below of how it works...

The syntax is:       DISPXY <x_pos>;<y_pos>;<font>;<object>:

The <x_pos> and <y_pos> are relative to the values of Xmin, Xmax, Ymin & Ymax as set in the PLOT SETUP view, and the font number can be either 1 (small) or 2 (large).  For example, the program shown left will produce the result shown right if the axes are set to the default values of -6.5 to 6.5 and -3.1 to 3.2.

The <x_pos> and <y_pos> values refer to the top left corner of the text when displayed.  The clipping rules are a bit complicated, probably due to the fact that the command was done in a bit of a hurry (in a hotel room late one night in Chicago!).  If the <x_pos>, <y_pos> corner is off the top of the screen or off the left edge of the screen then the string will not be displayed even if part of it is onscreen.  If there is sufficient room vertically for the string but part of it would display off the right edge of the screen then it will be partially displayed (see right).  On the other hand, if we were to move the text one more pixel downwards so that it would display partially off the bottom of the screen then it will not display at all.  The best way to satisfy yourself of this is to experiment.

Finally, the value of <object> can include variables of any kind.
For example you could have a command:

 DISPXY -6.5;0;1;"After "N" min the list is "L0:


65.  Why is my circle incomplete? 

Answer: The screen on your calculator is made up of small dots called pixels.  On the HP the screen is 131 pixels wide and 64 pixels high and this is the reason for the default settings for the axes in nearly every aplet.  On the x axis a setting of -6.5 to 6.5 gives 131 dots of 0.1 each (including zero).  Similarly a y axis of -3.1 to 3.2 gives 64 dots of 0.1 each.  Now you may be asking yourself "Why this odd size?" and, to be honest, I don't know.  I can only suggest that the reasons lie in the manufacturing process and costs.

Anyway, the point is that this affects your graphs and it becomes particularly obvious with circles because part of the graph does not exist (the part outside the circle).  Let's look at the circle x2+y2=9 as an example.  This circle only exists from -3 to 3 on the x axis and is undefined outside this domain.  In order to graph it on the HP you have to rearrange it into the form y=.... so that it becomes two equations:  F1(X)= (9-X2) for the top half and F2(X)= - (9-X2) for the bottom half.

If you enter these equations into the SYMB view and then graph them with the default axes (in PLOT SETUP press SHIFT CLEAR) then you get a perfect circle (see right).  However, if you go into PLOT SETUP and change the x axis from the default setting to -6 to 6 and then re-PLOT then a strange thing happens!  Part of the circle disappears.  This is shown in the snapshot at the start of the question. There's a reason for this, and it lies in the pixels.

When the calculator draws the graph it only calculates y values for the x values which fall on pixels.  After all, why bother calculating a value you can't display?  It just "joins the dots" for the values in between.  For the default scale of -6.5 to 6.5 this is not a problem since the edges of the circle at -3 and 3 fall on a pixel and this means that the last segment of the graph is from 2.9 to 3 and the circle reaches right down to the x axis.

However, for our new scale of -6 to 6 the pixels are no longer 'nice' values of 0.1.  If you try to TRACE the circle you'll see that the pixels fall on 0, 0.0923077, 0.1846154.....  In particular, near x=3 the pixel values are 2.953846 and 3.046154.  This means that the calculator can't draw anything past 2.953846 because the next value doesn't exist :- remember  (9-X2) is only defined for values up to 3.  This is what causes the gap in the circle.  There's nothing to join to past that last point.

So what's the solution?  If possible, just use scales which allow the end points of your circle to fall on a pixel point.  If your circle has a nice radius such as an integer then this is easily done by starting with the default axes and then ZOOMing in or out to show the circle.  I would suggest using the ZOOM menu to Set Zoom Factors to either 2 or 5.  This will tend to give 'nice' pixel points. If your circle is not centred on the origin then just check/tick the box in the Set Zoom Factors box to Recenter.  That will allow you to turn off TRACE, move the cursor closer to the point where you'd like the centre of screen to be and then ZOOM.

Unfortunately not all circles have a nice radius!  For example the end points of the semi-circles for x2+y2=10 will not fall exactly on a pixel point no matter what scale you choose.  Judicious choice may allow rounding to work in your favour but it's not always possible to set this up.

66.  How can I create an empty list using a command in a program?

Answer:  It is occasionally desirable to be able to create or store an empty list in a program.  The problem is that simply using {}L1 will just give a syntax error.  There are a couple of solutions to this, the simplest of which was contributed by Mark Howell. He points out that the command:
    SUB L1;L1;1;0
will store an empty list into L1.  This method can also be used to empty a statistics column inside a program since a list and a stats column are the same thing to the HP language.

67.  (39G/40G only) How much can the HP38G and HP39G communicate via their infra-red links?  What can I transfer?

Answer:  Because some changes were made to internal structures in the upgrade from the 38G to the 39G, aplets and lists cannot be transferred directly from a 38G to a 39G using the infra-red link.  However there is no problem transferring Notes, programs or matrices in either direction using the IR link.


If you try to transfer an aplet from the 38G to a 39G the process will appear to succeed.  However when you try to run this aplet on the 39G it will simply lock up the calculator and/or cause it to reboot with possible loss of memory.

If you wish to transfer an aplet or a list from a 38G to a 39G then you will need to save it from the 38G to a computer, update it using the HP utility covered below and then transfer to the 39G.  This process cannot be used to transfer backwards from 39G to 38G.

A free Windows utility has been provided by HP to convert 38G aplets and other objects to 39G format.  This utility can be downloaded from the ‘Utilities’ page on my web site. Using it is very simple, requiring only that you choose the directory containing the files and then click on the button labelled ‘Convert Files’.

Once converted, the files are no longer readable by a 38G.  For this reason it is advisable to convert a copy rather than the original.  As of early 2001 there was a known bug in this utility which causes the conversion process to fail if any of the files are set to be read-only. This is unlikely to be the case for the average user but in case of a failure this may be the reason.  To check, right click on each file and select ‘Properties’. If 'Read Only' is ticked then remove the tick.


68.  There is no question 68!

69.  How do I produce games and fast aplets like them on the HP?

Answer:   All of the material available on my site, except for a few exceptions (games and Quad Explorer) are written in HP Basic.  This is a fairly simple language to use for anyone who is at all experienced in programming.

There is a listing of all syntax and functions that make up HP-Basic in the manual and there are a number of examples of how to use the SETVIEWS command to link programs into a parent aplet.  In fact, I wrote most of that section of the manual (and yes, I know there were mistakes in the 39G version but I wasn't the only one writing it! :-) However the manual does not cover binary/assembly code programming (sRPL) on the machine because it was never intended to be programmed that way by the average user. The average user will want to use HP-Basic but it has two big disadvantages.

Firstly, it is a bit limited in some areas. For example it has no facility to manipulate strings, which can be very frustrating.  It also can't continuously check for key presses which means that games are more difficult to write.

Secondly, the program is stored on the calculator as a text file and compiled when you want to use it.  This is why there is a delay the first time you run any program.  Subsequent runs are faster because the calculator keeps the assembled copy.  Even so, a calculator created assembly code program is seldom as efficient as a human one as it doesn't have any of the optimization that a human can add. This means that programs written in HP-Basic are seldom fast enough for good games.

If you want to produce really fast games and other material such as that then, as I understand it, you must develop your programs on a PC and compile them on the calculator.  Unlike the HP48/49 family, the HP38/39/40 family members are not set up to do this directly - you have to develop the app on another platform and transfer.  All the really good games available for the HP39/40G are done like this.  The assembly level programming of the HP38/39/40G is VERY complex and tedious to use.  I did learn a little of it but didn't really have time to become expert. All the really good games available for the HP are done like this because sRPL is so much faster and more flexible than HP-Basic.

The most knowledgable people I know of who are writing these are:

bullet Michaël De Coninck. See my Help page for a great set of tutorials he has written on how to program in sRPL.
bulletDetlef Muller <>,
bulletLilian Pigallio who has written some absolutely amazing games for the HP39/40G (but whose page seems to have vanished as at Dec '07).

You should also check out for more information and programs.

Last modified: 19 Dec 2007                                             Sitemap        Home        Contact Me