# Largest number in ten bytes of code

Your goal is to print (to the standard output) the largest number possible, using just ten characters of code.

• You may use any features of your language, except built-in exponentiation functions.
• Similarly, you may not use scientific notation to enter a number. (Thus, no 9e+99.)
• The program must print the number without any input from the user. Similarly, no reading from other files, or from the Web, and so on.
• Your program must calculate a single number and print it. You can not print a string, nor can you print the same digit thousands of times.
• You may exclude from the 10-character limit any code necessary to print anything. For example, in Python 2 which uses the print x syntax, you can use up to 16 characters for your program.
• The program must actually succeed in the output. If it takes longer than an hour to run on the fastest computer in the world, it's invalid.
• The output may be in any format (so you can print 999, 5e+100, etc.)
• Infinity is an abstract concept, not a number. So it's not a valid output.
• Did you look at these two? codegolf.stackexchange.com/questions/185/… codegolf.stackexchange.com/questions/18028/… – MadTux Jun 13 '14 at 13:35
• What do you exactly mean by "calculate". Also, If it takes longer than an hour to run on any computer in the world, it's invalid. is not objective. I could (theoretically) manufacture a computer that takes an hour to change one T-state – user80551 Jun 13 '14 at 13:37
• Does bit-shift count as an exponentiation operator since it is equivalent to * 2^x ? – Claudiu Jun 13 '14 at 16:08
• The fact that the time limit depends on the performance of the fastest computer in the world makes it impossible for us to determine the set of valid answers... I don't really like that – David Z Jun 13 '14 at 19:45
• Exponentiation functions are not allowed, but ackermann function is allowed? That seems really arbitrary. It remains unclear why a symbolic manipulation is considered "calculating" the number. – Reinstate Monica Jul 7 '15 at 13:12

# Acc!!, 999999

19*3
Write _
Write _
Write _
Write _
Write _
Write _


As any code necessary to output anything is excluded, all 'Write ' statements are excluded.

Try it online!

• > Your program must calculate a single number and print it. You can not print a string, nor can you print the same digit thousands of times. – nonForgivingJesus Aug 10 '19 at 13:50

# PHP, 9 bytes, MAX INT (9223372036854775807)

echo ~0^1<<63;


or

echo -1^1<<63;


Set an int of all bits on (-1) then XOR it with an int of only the first bit on to flip the sign bit.

# Stacked, 10 bytes ~ 2 × 10273964

17932!:*:*


Try it online! Snippet outputs the length, then the number itself.

This calculates (17932!)4 (without exponentiation) using scientific precision, so only a constant width is perpetuated. The number looks like:

204449781735459736090000000000000000...00000000000000000


This Wolfram|Alpha link shows what the precise calculation would look like.

• it's currently broken :( – ASCII-only Apr 4 '19 at 0:46

# x86_64 machine language (Linux) ~2.808896e+307

0:       f2 0f 10 05 fa ff ff    movsd  -0x6(%rip),%xmm0        # 2
7:       ff
8:       c3                      retq
9:       7f


This moves the IEEE-754 double precision float 7f c3 ff ff ff fa 05 10 to %xmm0 and returns.

Try it online!

# Javascript (ES6), 4E+30103

9n<<99999n


Uses big integers so actually goes way past what normal integers could reach.

# C (gcc), 9 * 10^4202512

printf("9%.*u",""); or printf("9%0*u","");

Try it online!

The shortest way to print anything in C (afaik) is puts(""); which is 9 bytes
19 - 9 = 10

.* specifies precision which isn't exponentiation

.number

For integer specifiers (d, i, o, u, x, X) − precision specifies the minimum number of digits to be written. If the value to be written is shorter than this number, the result is padded with leading zeros. The value is not truncated even if the result is longer. A precision of 0 means that no character is written for the value 0. For e, E and f specifiers − this is the number of digits to be printed after the decimal point. For g and G specifiers − This is the maximum number of significant digits to be printed. For s − this is the maximum number of characters to be printed. By default all characters are printed until the ending null character is encountered. For c type − it has no effect. When no precision is specified, the default is 1. If the period is specified without an explicit value for precision, 0 is assumed.

https://www.tutorialspoint.com/c_standard_library/c_function_printf

So you'll get 9 followed by "" digits,(4202512)
the very last ones read from memory as the number to print is not specified,
adding ,0 would prevent memory reading but push it over the 10 byte limit

# 33, 7,762,279,691,451,941,920

999999axxao


I'm trying to get the language on TIO

# MathGolf, $$\\approx 1.609 \times 10^{1859933}\$$

9!!


Try it online!

With MathGolf being a language written in Python, the main issue will be calculating the number in a timely fashion. This program produces its output in about a minute. It might be possible to to $$\(10!)!\$$, which would be significantly bigger. However, the approach and the byte-count is still the same.

• This isn't valid I'm afraid. # isn't allowed because of the rule "You may use any features of your language, except built-in exponentiation functions." But even if you'd change it to *, I doubt it would be valid due to the rule "If it takes longer than an hour to run on the fastest computer in the world, it's invalid." Creating an array of timestamp!!!! amount of items in under an hour would be quite a feat. – Kevin Cruijssen Aug 16 '19 at 13:18
• @KevinCruijssen Oh, I should definitely have read the question more thouroughly... I'll think of another approach, and update the answer when I have one. – maxb Aug 16 '19 at 13:21
• @KevinCruijssen fixed and verified. – maxb Aug 16 '19 at 14:38

# Forth (gforth), 9 bytes, 7 bytes

-1. ud.


Try it online!

Produces: 340282366920938463463374607431768211455