How can you handle large numbers, e.g., 4115967000, precisely in K?Is there any equivalent of Java’s BigInteger?
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?>> >
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?
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?>> >
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!