perl6 - 将 Blob 中的数据转换为 Num

perl6 - Converting data in a Blob into a Num

我在 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 中有一些字节,因为它是适合 $blob

中可能存在的所有这 3 种格式的 class
  1. IEEE 浮动
  2. IEEE 双
  3. IEEE 长双

进行该转换的最佳方式是什么?

导入 NativeCall,转换为所需类型的指针并取消引用结果:

use NativeCall;
nativecast(Pointer[num32], $blob).deref;