Hacker News new | past | comments | ask | show | jobs | submit login

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



Not 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


For scale, there are an estimated 10^80 atoms in the entire universe.


Neither 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).


Yeah apparently each pixel of a 16-bit image can have 256 different colors. Oops.


That's an 8-bit image. Each pixel of a 16-bit image could have 2^16 = 65536 possible colours.


I give up. I shouldn't post before having coffee.


Python is probably trying to compute it exactly.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: