zlacker

[parent] [thread] 0 comments
1. nivert+(OP)[view] [source] 2026-02-03 10:31:14
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]