# 64-bits unsigned integers

**URL:** <https://forum.kx.com/t/64-bits-unsigned-integers/9257>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [November 18, 2014, 11:51pm UTC](https://forum.kx.com/t/64-bits-unsigned-integers/9257 "2014-11-18T23:51:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexandre\_beaul](https://avatars.discourse-cdn.com/v4/letter/a/2bfe46/32.png) [@alexandre\_beaul](https://forum.kx.com/u/alexandre_beaul)\
**Post date:** [November 18, 2014, 11:51pm UTC](https://forum.kx.com/t/64-bits-unsigned-integers/9257/1 "2014-11-18T23:51:00Z")

</div>

Income tax season is coming quick and I reached for my favorite number crunching tool to add everything up, however I ran into a problem:

q)  
q)income: 9223372036854775806  
q)income  
9223372036854775806  
q)  
q)income: 9223372036854775808  
'9223372036854775808  
q)income  
9223372036854775806  
q)

Looks like the biggest integer type in q is 64-bits \*signed\*, what if I have to interface with systems with 64-bits unsigned integers?

For example, I have CSV files to upload to KDB. In said files one column is Exchange Order IDs, which come in as 64-bits unsigned integers. I don’t want to use symbols as to not bombard the symbol table. Strings are inconvenient because comparing them is slow. Casting/converting said Order IDs to 64-bits signed integers prior to uploading to KDB would work but then I need to write a script to pre-process the CSVs and the number will be different to what’s in the rest of our systems. Am I missing an easier way to do this?

Thanks,  
Alex&nbsp;

---

<div class="post-metadata">

**Author:** ![charlie1](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@charlie1](https://forum.kx.com/u/charlie1)\
**Post date:** [November 19, 2014, 10:15am UTC](https://forum.kx.com/t/64-bits-unsigned-integers/9257/2 "2014-11-19T10:15:00Z")

</div>

for ids, you could use guids

q)“G”$"-"sv 0 8 12 16 20 cut{((32-count)#“0”),x}“9223372036854775808”

00000000-0000-0922-3372-036854775808

---

<div class="post-metadata">

**Author:** ![charlie1](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@charlie1](https://forum.kx.com/u/charlie1)\
**Post date:** [November 20, 2014, 1:56pm UTC](https://forum.kx.com/t/64-bits-unsigned-integers/9257/3 "2014-11-20T13:56:00Z")

</div>

another approach

q)b:0x0 sv{((16-count)#0x0),x}value"0x",“9223372036854775808”;b

00000000-0000-0922-3372-036854775808

q)0x0 vs b

0x00000000000009223372036854775808
