The HP39g and the HP 40g were released during the year 2000. They are made on the same hardware platform with 1MB of ROM, 256KB of RAM and has 51 keys. The physical difference between the HP39g and the HP 40g is the IR port - 40g does not have IR port. The software knows if it’s running on an HP39g or an HP 40g and will support aplets and programs accordingly. On the software side, the HP39G has CAS (Computer Algebra System) disabled.
The HP 40g is probably one of the best calculator available on the market. It’s cheap and has virtually the same mathematical capabilities as the HP 49.