64-bit integer

General APL language issues

64-bit integer

Postby KimmoLinna on Fri Nov 27, 2020 3:38 pm

Hi,

I am importing data from kdb+ with qconnect. I would like handle timestamp but I don’t know how to read 64-bit integer with ⎕DR, because 643 ⎕DR is missing. Does someone remember how to combine two 323 ⎕DR numbers (32-bit signed integers) into one 64-bit signed integer?

Best regards,

Kimmo
KimmoLinna
 
Posts: 4
Joined: Wed Nov 25, 2009 12:16 pm

Re: 64-bit integer

Postby KimmoLinna on Sat Nov 28, 2020 6:47 pm

The solution was quite simple when I realised kdb+ uses ones' complement system for negative numbers.

To64Int←{{⎕ml←3⋄(∊8⍴⊂(8⍴1),0){{1⊃⍵:-2⊥~⍵⋄2⊥⍵}∊⌽⍺⊂⍺\⍵}⍵}11 ⎕DR ⍵}

Best regards,

Kimmo
KimmoLinna
 
Posts: 4
Joined: Wed Nov 25, 2009 12:16 pm


Return to Language

Who is online

Users browsing this forum: No registered users and 1 guest