Skip to main content
deleted 2 characters in body
Source Link
doubleunary
  • 2.7k
  • 1
  • 2
  • 12

Google Sheets, 44 bytes

=ifs(A1<2^8,1,A1<2^16,2,A1<2^32,4,A1<2^64,8)

screenshot

Google Sheets uses IEEE 754 double-precision with a significand of 53 bits for pretty much everything, so cannot go all the way up to 64-bit unsigned.

The output format rules specified in the question are quite rigid. This alternative version outputs an array where the first true value marks the minimum bytes required by the unsigned integer (2523 bytes):

=sort((A2<2^2^{3,4,5,6}))

screenshot2

Google Sheets, 44 bytes

=ifs(A1<2^8,1,A1<2^16,2,A1<2^32,4,A1<2^64,8)

screenshot

Google Sheets uses IEEE 754 double-precision with a significand of 53 bits for pretty much everything, so cannot go all the way up to 64-bit unsigned.

The output format rules specified in the question are quite rigid. This alternative version outputs an array where the first true value marks the bytes required by the unsigned integer (25 bytes):

=sort((A2<2^2^{3,4,5,6}))

screenshot2

Google Sheets, 44 bytes

=ifs(A1<2^8,1,A1<2^16,2,A1<2^32,4,A1<2^64,8)

screenshot

Google Sheets uses IEEE 754 double-precision with a significand of 53 bits for pretty much everything, so cannot go all the way up to 64-bit unsigned.

The output format rules specified in the question are quite rigid. This alternative version outputs an array where the first true value marks the minimum bytes required by the unsigned integer (23 bytes):

=sort(A2<2^2^{3,4,5,6})

screenshot2

add alternative version
Source Link
doubleunary
  • 2.7k
  • 1
  • 2
  • 12

Google Sheets, 44 bytes

=ifs(A1<2^8,1,A1<2^16,2,A1<2^32,4,A1<2^64,8)

screenshot

Google Sheets uses IEEE 754 double-precision with a significand of 53 bits for pretty much everything, so cannot go all the way up to 64-bit unsigned.

The output format rules specified in the question are quite rigid. This alternative version outputs an array where the first true value marks the bytes required by the unsigned integer (25 bytes):

=sort((A2<2^2^{3,4,5,6}))

screenshot2

Google Sheets, 44 bytes

=ifs(A1<2^8,1,A1<2^16,2,A1<2^32,4,A1<2^64,8)

screenshot

Google Sheets uses IEEE 754 double-precision with a significand of 53 bits for pretty much everything.

Google Sheets, 44 bytes

=ifs(A1<2^8,1,A1<2^16,2,A1<2^32,4,A1<2^64,8)

screenshot

Google Sheets uses IEEE 754 double-precision with a significand of 53 bits for pretty much everything, so cannot go all the way up to 64-bit unsigned.

The output format rules specified in the question are quite rigid. This alternative version outputs an array where the first true value marks the bytes required by the unsigned integer (25 bytes):

=sort((A2<2^2^{3,4,5,6}))

screenshot2

Source Link
doubleunary
  • 2.7k
  • 1
  • 2
  • 12

Google Sheets, 44 bytes

=ifs(A1<2^8,1,A1<2^16,2,A1<2^32,4,A1<2^64,8)

screenshot

Google Sheets uses IEEE 754 double-precision with a significand of 53 bits for pretty much everything.