SAEED MAHMOOD ASLAM
SAEED MAHMOOD ASLAM

Reputation: 45

How to convert Dword to Qword

I want to convert Qword to Dword. By Programmer calculator, I easily convert it but not found any way in python.

Qword = 562949953442333
Dword = 21021

Upvotes: 1

Views: 1742

Answers (1)

blhsing
blhsing

Reputation: 106553

You can use bit-wise AND operator to mask the Qword with 0xffff:

print(562949953442333 & 0xffff)

This outputs:

21021

Upvotes: 4

Related Questions