[Question]
  [
Sometimes, while golfing, one needs to represent large number(s) in their code. Writing them as is can significantly increase the byte-count.
What *general*1 tips do you have for representing long numbers concisely in code?
Please post one tip per answer.
---
1With *general*, I mean tips that can be applied to more than a single language. For language-specific tips, post in their respective thread.
  
[Answer]
# Look out for special numbers
Some languages have built-in functions for squares, exponentiation with base 2, *n*-th prime, factorial, or other procedures that can generate large numbers. Check if you number *happens to fall* into any of those categories.
And if it doesn't, it may happen that a *larger* number that does will fit for your purposes and can be used instead.
[Answer]
# Use bitwise boolean operators
Some languages have bitwise AND, OR, XOR, and sometimes NOT.
Expressing a specific large number as a bitwise combination of a result of an exponentiation or left shift and another number can get you to precisely the number you need. This is usually only worth it if the numbers get quite big.
For example, `2147483722` is 10 bytes, but `2<<30^74` (2^31 bitwise-XORed with 74) is only 8.
[Answer]
## Use Strings for repetitive numbers
For numbers that are very repetitive in nature, you can use Strings and cast them to Integer. For Example, in JavaScript
```
+"1".repeat(100) // returns 100 1s (saves 84 bytes!)
```
[Answer]
## Use Scientific Notation
Scientific notation can save bytes in case of long numbers. For Example:
```
3564e-8 // returns 0.00003564 (saves 3 bytes!)
```
[Answer]
# Look for another number to use instead
This may sound like a non-answer, but it is not always obvious that a larger number can be calculated by shorter code. An example I remember is [Output a googol copies of a string](https://codegolf.stackexchange.com/questions/97975/output-a-googol-copies-of-a-string), where the obvious answers require computing 10100. As it turns out, computing any multiple of 10100 leads to an equally correct, but in some languages, shorter answer. Dennis's answer there uses 100100, my own uses 250255.
[Answer]
## Base Compression
Base decompression code can be fairly complex, but if you have a truly enormous number sometimes it can help to compress it in some base higher than 10.
It also helps that in some languages, the base compression code is very simple. For example, PHP has `base64_decode(_)`, Python has `int(_,36)`, JavaScript has `parseInt(_,36)`, and many golfing languages have base decompression builtins.
For example, in CJam:
```
"+ÜTbô±"256b
```
This contains an unprintable. [Try it online!](https://tio.run/nexus/cjam#@6@kfXhOSNKhiYe3HNqoZGRqlvT/PwA)
This yields:
```
12345678987654321
```
[Answer]
## Use exponential fractions for large repetitive numbers
Say you wanted to generate the number made of 100 1's. You could use `int("1"*100)`, `+"1".repeat(100)`, etc. but you can also take advantage of the fact that it's very close to
```
1e100/9
```
This works best for very repetitive numbers, such as those made of a single digit. A couple repeated digits also works fairly well:
```
12e100/99  // Generates 121212121212... (100 digits)
```
Occasionally you'll find some other weird pattern which also can be represented fairly tersely in this method. If you happened to need `int("123456790"*11)`, for example:
```
1e100/81
```
Be careful, though: numbers such as `int("1234567890"*10)` don't have such an easy representation.
[Answer]
## Use Bitwise Left Shift for 2's exponentiation
Although, there are many languages that support operator for exponentiation, some do not. And those which don't, usually require calling functions (or Class/Object methods), which can cost a few bytes.
But you can save some bytes when you need to raise 2 to the power *n* by using the Bitwise Left Shift operator `<<` as `1<<n`. Note that this will only save you bytes if *n* is greater than or equal to 17. However, this will *always* save you bytes if *n* is dynamic. Few Examples:
```
1<<2 // returns 4 (3 bytes more :( )
1<<3 // returns 8 (3 bytes more :( )
1<<6 // returns 64 (2 bytes more :( )
1<<14 // returns 16384 (no bytes saved)
1<<17 // returns 131072 (saves 1 byte!)
1<<18 // returns 262114 (saves 1 byte!)
```
[Answer]
# Chinese Remainder Theorem
If arbitrary big integers frequently appear, or big integer representation in target programming language costs too many bytes, you can consider using Chinese Remainder Theorem.
Choose some pairwise relatively prime integers mi >=2, and you can express a big number from 0 to lcm(m1, m2, ... , mi) -1
For example, I choose 2, 3, 5, 11, 79, 83, 89, 97, then I can express number less than 18680171730 uniquely. 10000000000 (1e10) can be expressed as 0,1,0,1,38,59,50,49 (1e10 mod 2, 3 ... , 97) which need not be expressed as special Big Integer class/struct which might save some bytes in some programming language.
Addition and substraction can be done directly using this representation.
Example:
```
(0,1,0,1,38,59,50,49)+(0,2,0,6,23,20,16,53) = 1e10 + 5000 
                                            = (0+0 mod 2, 1+2 mod 3, 0+0 mod 5, 1+6 mod 11, 38+23 mod 79, 59+20 mod 83, 50+16 mod 89, 49+53 mod 97)
```
[Answer]
# Use String Padding (where possible)
If a large number includes a repeating digit at the beginning or end, you may be able to save bytes by using your one of your language's padding methods to construct a string of the number you're looking for, which you can then convert to an integer.
---
# Example
To generate the number `1111111111111111111111112` (25 bytes) in JavaScript (ES8):
```
+"2".padStart(25,1) // 19 bytes
```
[Answer]
# Use Exponents
If your language has an exponent operator you might be able to use it to generate, if not the number you want, at least a number you can perform a simple calculation or 2 on to arrive at your number. Even without an operator, you may still be able to save bytes with a built-in function or method.
## Example
The [maximum safe integer in JavaScript](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) is `9007199254740991`, which is 16 digits long. In ES7, this can be calculated with the following 7 bytes:
```
2**53-1
```
The equivalent in ES6 and earlier, while the same length as the integer itself in this instance, demonstrates that using a more verbose method might not necessarily cost you any bytes.
```
Math.pow(2,53)-1
```
The above, though, may work out *shorter* if, for example, you already have `Math` aliased to a single character elsewhere in your code.
[Answer]
# Use fractions in the place of float
Example: `1./3` in place of `0.333333333`
]