KX Community

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

Home Forums kdb+ Largest float value KDB can handle

  • Largest float value KDB can handle

    Posted by ekallivrousis on October 8, 2021 at 12:00 am

    Whats the largest decimal value KDB can handle. Im looking to deal with numbers that have over 17 decimal places

    ekallivrousis replied 8 months ago 2 Members · 1 Reply
  • 1 Reply
  • davidcrossey

    Member
    October 9, 2021 at 12:00 am

    Hi ekallivrousis,

    The largest decimal value would be the float type as per Data types

    q)(2 xexp 1023)*1+1-2 xexp -52 
    1.7976931348623157e+308

    See here for more Double-precision floating-point format

    Also note that the q console can only display float values to 17 significant figures, e.g.

    q)P 
    7i 
    q)1.123456789 
    1.123457 
    q)P 0 /this is eqiuvalent to P 
    17 
    q)P 
    0i 
    q)0.11111111111111112 
    0.11111111111111112 
    q)1.11111111111111112 
    1.1111111111111112

    Further reading here:

    Hope this helps, and thanks for sharing your query on the Community portal!

    Kind regards,

    David

Log in to reply.