zlacker

[return to "The largest number representable in 64 bits"]
1. nivert+Ob2[view] [source] 2026-02-03 07:49:32
>>tromp+(OP)
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).

◧◩
2. pseudo+zr2[view] [source] 2026-02-03 09:48:06
>>nivert+Ob2
Came here to say the same thing. In my encoding there are close to 2^64 standard numbers and a few values just below the top end reserved for encoding of hyperoperations. That should cover most requirements, including silly ones.
◧◩◪
3. nivert+Zw2[view] [source] 2026-02-03 10:31:14
>>pseudo+zr2
That's similar to how kdb+/q represent nulls and infinities

This is certainly pragmatic, although it breaks the math

  q type        size   q literal forms                                   underlying integer value (encoding)
  ----------------------------------------------------------------------------------------------------------
  short (h)     16-bit 0Nh / -0Wh / 0Wh                                  null = -32768; -inf = -32767; +inf = 32767
  int (i)       32-bit 0Ni / -0Wi / 0Wi                                  null = -2147483648; -inf = -2147483647; +inf = 2147483647
  long (j)      64-bit 0N (or 0Nj) / -0W (or -0Wj) / 0W (or 0Wj)          null = -9223372036854775808; -inf = -9223372036854775807; +inf = 9223372036854775807
--

https://code.kx.com/q/basics/datatypes/

https://code.kx.com/q/basics/datatypes/#infinities

[go to top]