Naneinf

The score display of Naneinf.

Naneinf is the score displayed when a player achieves a score greater than ~1.80e308. Similarly, the target score for Ante 39 is "nan", since 4.8e309 overflows to Naneinf.

'nan' means Not a Number, 'e' is the scientific notation for the exponent, specifically where the game is multiplying a number by 10 raised to a power, and 'inf' is an abbreviation for Infinity.

This is why Mr. Bones does not prevent death on Ante 39: the player's score is compared to 25% of nan, which is nan, and therefore it is determined the player did not score enough to be saved by Mr. Bones. These limitations make it impossible to progress past Ante 39. LocalThunk has stated that while it was "an accident", he does not intend to fix it, considering it "iconic".[1]

Mathematics

Crash error report displayed when a player continues to play the game after achieving Naneinf.

Balatro uses the IEEE-754 double-precision floating point format which has a finite amount of space to store uncountably infinite values. In practice any value over ~1.80e308 is just called “Infinity”.

1.80e308 ≈ 2^1024 × (1 − 2-53) which is the largest representable 64-bit floating point number.

The game code has to figure out how to display extremely high numbers in the score counter. First it checks if the number is less than 1e11. Since “Infinity” is indeed greater than 1e11, it must be displayed in scientific notation.

Then the game checks what the base 10 logarithm of the number is, rounded down - this is the number after the exponent “e”. For 5.4e12, this is 12. For 1e24 it is 24. IEEE-754 says that log10(Infinity) = Infinity, which rounds down to Infinity, or 'inf' for short.

The final step is to get the mantissa, which is obtained by dividing the original score by 10 to the power of the rounded down exponent: 5.4e12/(1012) is 5.4, and Infinity/(10Infinity) = Infinity/Infinity which is illogical. IEEE-754 says this is an invalid operation, and declares that the result is Not A Number: 'NaN'.

The game turns these outputs into text strings — “nan” and “inf” — and displays them with the scientific notation “e” (the exponent, meaning times 10 to the power of) in the middle to get “naneinf” in the score counter. Because this is only how your score is displayed, it still functions as expected for positive infinity; a hand score of "naneinf" beats any valid target score, etc.

A similar procedure is applied when getting blind amounts in Endless Mode to round the target score to the first few significant digits -- however, unlike the hand score, this modifies not merely how the number is displayed, but the actual value, resulting in an invalid target score which is actually not a number. All mathematical comparisons are considered false when comparing to nan.

Methods

Though most naneinf methods use Baron and Mime, having many copies of the two jokers is not enough to achieve the score, and the player is extremely unlikely to hit naneinf if they are not familiar with the necessary strategies. Some of these strategies include:

  • Creating many Negative copies of Cryptid with Perkeo, and using them to surpass the typical hand size limit.
  • Using Burglar, The Serpent and many copy effects on Plasma Deck, which under particular circumstances, is just barely enough to reach naneinf.
  • Utilizing the scoring from a Perkeo-boosted Observatory to supplement a strong Baron and Mime run.
  • Creating many Negative copies of Ectoplasm and Ankh with Perkeo to repeatedly clone an Eternal joker, such as Joker Stencil.
  • Skipping for a well-timed Juggle Tag on Anaglyph Deck for an extreme boost to hand size.
  • Exploiting one of the bugs that increases hand size.

Note that if you're looking to achieve naneinf for the first time, the first two methods are the easiest and most consistent. See Guide: naneinf for a full guide.

References

  1. "It was an accident and it's kinda perfect. Yeah iconic" - LocalThunk in the Balatro Discord