KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ wavg implementation detail Re: wavg implementation detail

  • leahs

    Member
    September 2, 2021 at 12:00 am

    Hello Ian,

    Thank you for bringing this great question to our attention.

    • We can confirm that
      0 wavg x

      should indeed be 0n. This is a bug and will be fixed by our team. Thank you for sharing this observation.

    The following is an explanation for the other cases:

    • Atoms on both sides behave as if enlisted to single item vectors.
    5 wavg 5  / 5 enlist[5] wavg enlist[5] /5
    • An atom on one side and a vector on the other behaves as if the atom is repeated to match the length of the vector.
    2 wavg 2 3 7  / 4 2 2 2 wavg 2 3 7 /4  5 2 3 wavg 3  / 3 5 2 3 wavg 3 3 3 /3

    We hope our feedback is helpful for you.

    Thank you again for your contribution and engagement with our KX community. We look forward to more.

    Kind regards,

    Leah