Live data from Hacker News

The largest number representable in 64 bits

tromp.github.io

91–98 of 98 posts

Re: The largest number representable in 64 bits

#91

Hi guys, I've come up with a new 64 bit number representation where 0xFFFFFFFF is infinity. Hell you know what every value is just infinity.

Unfortunately, someone else had this idea before you. Arithmetic operations with saturation for integers, either unsigned saturation or signed saturation, have been introduced in personal computers since Intel Pentium MMX (launched in January 1997). A few other CPUs and DSPs had such operations much earlier. "Saturation" means that the highest representable number, e.g. 0xFFFFFFFF, is interpreted as positive infinity…

I'll sue the bastards for retroactive copyright infringement.

Re: The largest number representable in 64 bits

#92
post #32

Please no more comments to the extent of "i can define a much larger number in only 1 bit". What makes my blog post (hopefully) interesting is that I consider tiny programs for computing huge numbers in non-cheating languages, that are not specifically equipped for doing so.

I found the problem itself to be poorly defined.

> What if we allow representations beyond plain data types? Since we want representations to remain computable, the most general kind of representation would be a program in some programming language. But the program must be small enough to fit in 64 bits.

If you bring in a whole programming language, you bring in a lot more than 64 bits. This all seems to be the math equivalent of saying you wrote a program in 2k when the first line is "import 'megalibrary'".

Re: The largest number representable in 64 bits

#93

The correct answer is: the largest number representable in 1 bit is any number (including +infinity and beyond). This article describing various Rube Goldberg machines, there is no need to agree on different ways of representing numbers when one can set a single bit to 1 to represent any desired pre-defined number, or 0 to represent its absence (or the number 0).

A Rube Goldberg machine is one intentionally designed to perform a simple task in a comically overcomplicated way, usually consisting of a series of simple unrelated devices.

Programs like Melo and w128 are the opposite, performing a hard task with the simplest means, using only a few highly inter-related parts.

Your proposed representation is exactly the kind of cheating, to get the results you want, that the article purposely avoids.

Re: The largest number representable in 64 bits

#95
post #93

The correct answer is: the largest number representable in 1 bit is any number (including +infinity and beyond). This article describing various Rube Goldberg machines, there is no need to agree on different ways of representing numbers when one can set a single bit to 1 to represent any desired pre-defined number, or 0 to represent its absence (or the number 0).

A Rube Goldberg machine is one intentionally designed to perform a simple task in a comically overcomplicated way, usually consisting of a series of simple unrelated devices. Programs like Melo and w128 are the opposite, performing a hard task with the simplest means, using only a few highly inter-related parts. Your proposed representation is exactly the kind of cheating, to get the results you want, that the articl…

1. s/The largest number representable in 64 bits/The widest set of numbers representable in 64 bits/

2. Using a Turing machine to model a von Neumann machine looks exactly like a Rube Goldberg machine. It even resembles it [1].

3. There is no point in talking about a 64-bit limit when the underlying model requires an infinite amount of RAM (tape).

4. > A Rube Goldberg machine is one intentionally designed to perform a simple task in a comically overcomplicated way

People usually don't realize they've built a Rube Goldberg machine...

5. > Programs like Melo and w128

My point is that just as you pre-defined the program you're going to use, you can pre-define the largest integer. That's 1 bit of entropy. I was working on a project with custom 5-bit floating-point numbers implemented in hardware, and they had pre-defined parts of the mantissa. So the actual bits are just part of the information.

---

1. https://en.wikipedia.org/wiki/Turing_machine#/media/File:Tur...

Re: The largest number representable in 64 bits

#97
post #50

It all goes over my head, but, what does the distribution of values look like? e.g. for unsigned integers its completely flat, for floating point its far too many zeros, and most of the numbers are centered around 0, what do these systems end up looking like?

Let me go ahead and compute that for all halting lambda terms of length at most 33 bits. The output I got from a modified BB.lhs is (giving the normal form size and the number of terms with that normal form size): 4x208506 6x203638 7x93072 8x202741 9x62039 10x189422 11x101450 12x183896 13x96804 14x167842 15x103631 16x131387 17x100319 18x161560 19x148361 20x180227 21x117866 22x82568 23x90577 24x136315 25x158660 26x207…

Another comment asked for the smallest unrepresented number with 64 bit programs. While I cannot give a definite answer there, and one may never be found, here we see that the first unrepresented normal form size for programs up to 33 bits is 83, a number with only 7 bits. Curiously, there are 7 unrepresented numbers even before the first uniquely represented number, 101.

Re: The largest number representable in 64 bits

#98
the article misses log-math and log-log-math which would use 64-bit (d)oubles are exponents in 10^d and 10^(10^d) respectively, which allows far higher range of possible values but somewhat more awkward math operations(addition/subtraction), though much more practical & faster to compute.
Post reply on HN