Home › Forums › kdb+ › Function return notation. › Re: Function return notation.
-
Two expressions: one multiplies
0+0
by1%0&0
; the other adds them.The sum of two long zeros is long zero.
1%0
is float infinity0w
. The type of the right argument does not matter; Divide always returns a float.So the comparison is between
0*0w
and0+0w
.The latter is
0w
. Surely expected: infinity plusx
is infinity.The unexpected result then is
0*0w
. Is not0*x
always zero? But here its a float null0n
. I do not know the mathematical justification for this; perhaps someone else can shed light?BTW your lambdas could be simpler:
test1:{(x+y)*1%x&y} test2:{(x+y)+1%x&y}