NULLs in q and in k.h

1

I've found different values for h NULLs between k.h and q:

q)0x00 vs 0W
0x7fffffffffffffff
q)0x00 vs 0N
0x8000000000000000
q)0x00 vs 0Ni
0x80000000
q)0x00 vs 0Wi
0x7fffffff
q)0x00 vs 0Wh
0x7fff
q)0x00 vs 0Nh
0x8000

In q it all looks familiar, but in k.h nh seems quite strange:

// nulls(n?) and infinities(w?)
#define nh ((I)0xFFFF8000)
#define wh ((I)0x7FFF)
#define ni ((I)0x80000000)
#define wi ((I)0x7FFFFFFF)
#define nj ((J)0x8000000000000000LL)
#define wj 0x7FFFFFFFFFFFFFFFLL

Why is it the (I)0xFFFF8000 value for nh? - Why they didn't just put simply (H)0x8000?

kdb
k
asked on Stack Overflow Oct 15, 2020 by egor7

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0