KX Community

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

Home Forums kdb+ Five easy pieces #2: getting around Re: Five easy pieces #2: getting around

  • SJT

    Member
    March 19, 2024 at 10:55 am
    rnd:{[x;nd;m] string%[;s]((ceiling;floor;floor 0.5+)`up`dn`nr?m)@:x*s:10 xexp nd}

     

    Here the case structure is not a dictionary, just a mapping from the symbols to functions. The primitives all iterate implicitly: the Each Left : is used only to support multiple rounding modes.

    In the list of unary functions the third item floor 0.5+ is an implicit composition of two unaries: floor and the projection 0.5+.