Crates.io | fi2b |
lib.rs | fi2b |
version | 1.0.0 |
source | src |
created_at | 2024-01-19 07:33:47.52257 |
updated_at | 2024-01-19 07:33:47.52257 |
description | Convert floating point and integer numbers into bytes and put them into an array |
homepage | |
repository | https://github.com/2A5F/fi2b |
max_upload_size | |
id | 1105045 |
size | 4,742 |
Convert floating point and integer numbers into bytes and put them into an array
let a: &[u8] = &fi2b![1, 2, 1.0, -1.0];
assert_eq!(
a,
[1u8, 0u8, 0u8, 0u8, 2u8, 0u8, 0u8, 0u8, 0u8, 0u8, 128u8, 63u8, 0u8, 0u8, 128u8, 191u8]
)