【发布时间】:2018-10-09 16:39:36
【问题描述】:
我在blob, an immutable buffer for binary data 中有一些字节,我正在寻找一种方法将它保存的内容转换为floating point data structure, Num,因为它是适合所有可能在 $blob 中的所有这 3 种格式的类
- IEEE 浮点数
- IEEE 双
- IEEE 长双
进行这种转换的最佳方式是什么?
【问题讨论】:
标签: raku representation
我在blob, an immutable buffer for binary data 中有一些字节,我正在寻找一种方法将它保存的内容转换为floating point data structure, Num,因为它是适合所有可能在 $blob 中的所有这 3 种格式的类
进行这种转换的最佳方式是什么?
【问题讨论】:
标签: raku representation
导入NativeCall,执行转换为所需类型的指针并取消引用结果:
use NativeCall;
nativecast(Pointer[num32], $blob).deref;
【讨论】: