# Large numbers

**URL:** <https://forum.kx.com/t/large-numbers/6118>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [June 11, 2009, 6:24pm UTC](https://forum.kx.com/t/large-numbers/6118 "2009-06-11T18:24:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![annakh71](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@annakh71](https://forum.kx.com/u/annakh71)\
**Post date:** [June 11, 2009, 6:24pm UTC](https://forum.kx.com/t/large-numbers/6118/1 "2009-06-11T18:24:00Z")

</div>

How can you handle large numbers, e.g., 4115967000, precisely in K?Is there any equivalent of Java’s BigInteger?

---

<div class="post-metadata">

**Author:** ![Attila](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@Attila](https://forum.kx.com/u/Attila)\
**Post date:** [June 11, 2009, 10:15pm UTC](https://forum.kx.com/t/large-numbers/6118/2 "2009-06-11T22:15:00Z")

</div>

X-Mailer: iPhone Mail (5H11)Subject: Re: [personal kdb+] Large numbersDate: Thu, 11 Jun 2009 23:15:31 +0200Cc: Kdb+ Personal Developers No, but longs can usually handle numbers big enough4115967000j AttilaOn 11 Jun 2009, at 19:24, annakh7 wrote:\>\> How can you handle large numbers, e.g., 4115967000, precisely in K?\> Is there any equivalent of Java’s BigInteger?\>\> \>

---

<div class="post-metadata">

**Author:** ![annakh71](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@annakh71](https://forum.kx.com/u/annakh71)\
**Post date:** [June 12, 2009, 12:32am UTC](https://forum.kx.com/t/large-numbers/6118/3 "2009-06-12T00:32:00Z")

</div>

While we are on the topic of numbers, an extremely annoying feature ofQ isthat it prints floats in a format that it is not valid input, so youcan’t round-trip(e.g, cut and paste).q)4115967000f4.115967e+009q)4.115967e+00913.11597The correct exponential format on the input side is 4.115967E9. Thatis very,very annoying. Can Q be forced to use the E9 instead of e+009 notationwhenprinting?

---

<div class="post-metadata">

**Author:** ![Attila](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@Attila](https://forum.kx.com/u/Attila)\
**Post date:** [June 12, 2009, 8:54pm UTC](https://forum.kx.com/t/large-numbers/6118/4 "2009-06-12T20:54:00Z")

</div>

X-Mailer: iPhone Mail (5H11)Subject: Re: [personal kdb+] Re: Large numbersDate: Fri, 12 Jun 2009 21:54:55 +0200Cc: Kdb+ Personal Developers No, it’s been asked before but it was ignored by arguing that it is not that hard to do it yourself (ssr on string, etc)Of course I agree that k3 having an output format for everything which could be parsed as input was a really nice property. On the other hand I have to admit it is - again! - something which one can live without / work around easily. AttilaOn 12 Jun 2009, at 01:32, annakh7 wrote:\>\> While we are on the topic of numbers, an extremely annoying feature of\> Q is\> that it prints floats in a format that it is not valid input, so you\> can’t round-trip\> (e.g, cut and paste).\>\> q)4115967000f\> 4.115967e+009\> q)4.115967e+009\> 13.11597\>\> The correct exponential format on the input side is 4.115967E9. That\> is very,\> very annoying. Can Q be forced to use the E9 instead of e+009 notation\> when\> printing?\>\> \>

---

<div class="post-metadata">

**Author:** ![annakh71](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@annakh71](https://forum.kx.com/u/annakh71)\
**Post date:** [June 16, 2009, 12:24am UTC](https://forum.kx.com/t/large-numbers/6118/5 "2009-06-16T00:24:00Z")

</div>

The K author and the K community in general make much of elegance.But do this sort of things more than a few times and it’s no longerelegant!
