RuneBlaze / atomicx

Easy-to-use Python atomic variables for cross-thread counters and more
MIT License
3 stars 0 forks source link

Support for atomic doubles #1

Closed BishopWolf closed 3 weeks ago

BishopWolf commented 3 weeks ago

Please add support for atomic doubles. Although it is easy to implement using struct pack and unpack. It is better to have something handled natively.

Naive implementation

>>> d = 1.234
>>> b = struct.pack('d', d)
>>> b
b'X9\xb4\xc8v\xbe\xf3?'
>>> d2, = struct.unpack('d', b)
>>> d2
1.234
RuneBlaze commented 3 weeks ago

Sure let me look into it 🤔 .... Good suggestion!

RuneBlaze commented 3 weeks ago

Ok version 0.0.13 should do it -- see the updated README and DOCS 🫥 .