4 ms·
I tried calculating this number for 16-bit images in Python (8^8^16), and the interpreter just froze. Go was pretty quick though: 3.940200619639448e+115
by jniedrauer 7y ago
I tried calculating this number for 16-bit images in Python (8^8^16), and the interpreter just froze. Go was pretty quick though: 3.940200619639448e+115
- DeusExMachina 7y agoFor scale, there are an estimated 10^80 atoms in the entire universe.
- esoterica 7y agoNeither of those numbers are correct. Firstly, exponentiation is right associative so 8^8^16 ≠ (8^8)^16 ≈ 3.94e+115. Secondly, that number is wrong anyway. The correct number is (2^16)^(8*8).
- jniedrauer 7y agoYeah apparently each pixel of a 16-bit image can have 256 different colors. Oops.
- messe 7y agoThat's an 8-bit image. Each pixel of a 16-bit image could have 2^16 = 65536 possible colours.
- jniedrauer 7y agoI give up. I shouldn't post before having coffee.
- hansvm 7y agoPython is probably trying to compute it exactly.
- ericfrederich 7y agoNot sure where that math came from. 16 bit 8 by 8 pixel image would be 16^(8x8) or in Python... print(f"{16 ** (8*8):.4E}") 1.1579E+77 EDIT: I calculated 16 color, not 16 bit. Disregard Python wanted to use a float to convert to exponential format but it overflowed. Need to use strings ;-) n=(2**16)**(8*8); s=str(n); print(s[0] + '.' + s[1:6] + 'E+' + str(len(s) - 1)) 1.79769E+308
- deleted 7y ago[deleted]