I've got some bytes in a blob, an immutable buffer for binary data and I am looking for a way to convert what it holds into a floating point data structure, Num
, since it is the class that fits all those 3 formats that could be in the $blob
What would be the best way of doing that conversion?
Import NativeCall
, perform a cast to a pointer of desired type and dereference the result:
use NativeCall;
nativecast(Pointer[num32], $blob).deref;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With