We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e58f7d commit b6b5ad5Copy full SHA for b6b5ad5
crates/wasmparser/src/readers/core/operators.rs
@@ -88,6 +88,14 @@ impl Ieee32 {
88
}
89
90
91
+impl From<f32> for Ieee32 {
92
+ fn from(value: f32) -> Self {
93
+ Ieee32 {
94
+ 0: u32::from_le_bytes(value.to_le_bytes()),
95
+ }
96
97
+}
98
+
99
impl From<Ieee32> for f32 {
100
fn from(bits: Ieee32) -> f32 {
101
f32::from_bits(bits.bits())
@@ -108,6 +116,14 @@ impl Ieee64 {
108
116
109
117
110
118
119
+impl From<f64> for Ieee64 {
120
+ fn from(value: f64) -> Self {
121
+ Ieee64 {
122
+ 0: u64::from_le_bytes(value.to_le_bytes()),
123
124
125
126
111
127
impl From<Ieee64> for f64 {
112
128
fn from(bits: Ieee64) -> f64 {
113
129
f64::from_bits(bits.bits())
0 commit comments