Negative gold

From NetHackWiki
Jump to: navigation, search

Negative gold is a side effect of integer overflow. If a stack of more than 2147483647 gold pieces is ever created, it becomes negative because it is interpreted as a signed integers. (In some 64-bit builds, you need a considerably larger stack to produce the effect; 64-bit negative gold is not widely understood, because some of its effects are based on all 64 bits and and some on only the bottom 32.) A stack of negative gold has several strange properties.

Creation

In wizard mode, wish for the highest possible amount of gold (2147483647). Then, wish for 1 more gold piece. When combined, the stack turns into -2147483648 gold. You can then optionally wish for more gold to make it more manageable.

In unpatched versions of NetHack 3.4.3, it was also possible to produce negative gold using a bug in the implementation of the stone to flesh spell. If you cast the spell at a monster who was petrified with gold in inventory and who has ever been tame, the monster will be unpetrified with two stacks of gold in inventory. Although this normally only produces linear growth, because the bug only duplicates one stack, taming the monster can manipulate it to drop and pick up the stacks, merging them. Enough doublings will overflow the stack to a negative size, This is normally done with a nymph, which has infinite carry capacity and thus can carry the very large stacks of gold produced. The bug was patched out on most public servers and by most variants, and was fixed in NetHack 3.6.0.

Properties

When it was available, negative gold had some strange properties (which still probably apply if you obtain it using wizard mode):

  • Because it has negative weight, negative gold decreases your burden level. A maximum-sized stack of negative gold has a negative weight approximately equivalent to that of 42949 loadstones.
  • Eating negative gold (as a rock mole or other lithovore) makes you more hungry. A maximum-sized stack can make you faint for over 30,000 turns.
  • Negative gold reacts strangely with shops. Dropping it, instead of giving you credit, gives you debt. Then, if you leave the store, the Keystone Kops come after you. Likewise, if negative gold is already in a shop (say because you dropped it there earlier and have pacified the shopkeeper), picking it up will give you credit rather than debt.
  • You cannot split a stack of negative gold; attempting to drop just part of it will always drop the entire stack.