5 ms·
IEEE754 64-bit representation already has infinity: uint64_t x = 0x7ff0000000000000ULL; printf("%f\n", *(double *)&x); output: inf But you could
by matja 3y ago
IEEE754 64-bit representation already has infinity:
uint64_t x = 0x7ff0000000000000ULL;
printf("%f\n", *(double *)&x);
output:
inf
But you could use a representation where 0 is 0, and 1 is infinity, saving 63 bits...
- summerlight 3y agoThat doesn't qualify the explicitly stated condition "a largest (finite) representable value".
- loxias 3y ago> But you could use a representation where 0 is 0, and 1 is infinity, saving 63 bits... Reminds me of the hilarious and brilliant: http://tom7.org/nand/ http://tom7.org/nand/
- 1letterunixname 3y agoFloating format 1:1:0:1's 8 possible values: 000: +0 001: +1 ( denormal: (-1)^0 * 0.5 * 2^(-0+1) ) 010: +inf 011: +qnan 100: -0 101: -1 ( denormal: (-1)^1 * 0.5 * 2^(-0+1) ) 110: -inf 111: -qnan === Floating point crib sheet === --- Format --- Sign:exponent:stored explicit mantissa leading bit:mantissa fraction: binary16 = 1:5:0:10 bfloat16 = 1:8:0:7 TensorFloat = 1:8:0:10 fp24 = 1:7:0:16 binary32 = 1:8:0:23 binary64 = 1:11:0:52 8087 = 1:11:1:67 binary128 = 1:15:0:112 --- Interpretation --- leading bit = (exponent != 0) ? 1 : 0 when implicit (not stored) bias = 2^(exponent bits - 1) - 1 value = (-1)^sign * 0 when zero value = (-1)^sign * {{leading bit}}.{{mantissa fraction}}b * 2^(exponent - bias) when normal value = (-1)^sign * 0.{{mantissa fraction}}b * 2^(-bias+1) when denormal --- Classification --- zero = exponent == 0 && mantissa fraction == 0 denormal = exponent == 0 && mantissa fraction != 0 normal = exponent != 0 && exponent != ~0 inf = exponent == ~0 && mantissa fraction == 0 nan = exponent == ~0 && mantissa fraction != 0 snan = nan && msb(mantissa fraction) == 0 qnan = nan && msb(mantissa fraction) == 1 PS: It often takes fewer gates to implement a simpler microcoded microarchitecture than to implement a single hardwired macroarchitecture. Microcoded architectures are theoretically slower than hardwired but this is often not the case in reality because of the costs of gate fanout and extra gates for clock distribution that ameliorate gains of fully specified and decoded in hardware.
- tromp 3y agoI don't consider infinity to be a number though. Especially not in a largest number contest.
- lowq 3y agoLet 0 correspond to zero, and 1 corresponded to Rayo's number. Crisis averted!
- danbruc 3y agoLet all values encode Rayo's number. 64 bits saved!
- tromp 3y agoI find Loader's number [1] more interesting, as it is actually computable, yet far far larger than other famous computable numbers, like Friedman's TREE(3) or SCG(3). I'm looking forward to one day programming it in the lambda calculus, and seeing how much smaller than the existing ~500 bytes of C-code it can be. [1] https://www.youtube.com/watch?v=q6Etl4oGL4U&list=PL-R4p-BRL8NR8THgjx_DW9c92VHTtjZEY&index=4 https://www.youtube.com/watch?v=q6Etl4oGL4U&list=PL-R4p-BRL8...
- toxik 3y agoFair, but also an uninteresting answer.
- pphysch 3y agoIt's about as interesting as the other answers proposed in TFA, and it gets to the meat of it: they are all just representations invented by people, and there's nothing stopping us from inventing our own representations that fit into 64 bits (or 1 bit).
- toxik 3y agoNo, it doesn’t. The question is “what is the largest non-trivial number you can represent with some constraint on size of its expression”. It’s a really old question, and saying “infinity” as an answer misses the point. Saying you can invent an arbitrary number system also misses the point by simply not answering. If you need to spend a bunch of bytes explaining your new system, did you really use 8 bytes? It just feels really bad faith.
- pphysch 3y agoWhat is "really bad faith" about saying "An ON bit indicates the value 'googolplex'?" Computing is fundamentally about decoding bit strings as different arbitrary representations that are meaningful to humans.
- tromp 3y agoEven the word "googolplex" is quite a bit longer than the lambda calculus program in question...
- 8note 3y agoThe actual bit is just 1 though, the word "googolplex" is in the accompanying documents for interpreting the bit. The course on reading and using lambda calculus is similarly longer than than the actual lambda calculus expression