#Convert an array of []f64 to []8 for processing in another langauge

1 messages · Page 1 of 1 (latest)

plush pecan
#

I have an array of f64s that I'd like to process in javascript
Is your question about webassembly and the browser and if so, do you mean that you want to process them as a Float64Array? Because the answer to that question is a bit different from the question of bitwise converting []f64 to []u8

drifting yew
#

Specifically interested in the bitwise conversion from []f64 to []u8

#

Basically if I have a slice of floats

#

and each float is 8 bytes

#

I should be able to convert each float to 8 u8s

#

Is this what I'm doing with sliceAsBytes? It just seems weird with the first 15 or so bytes being fixed...

#

you know it might be my Js that's the issue because the outputted bytes make sense in zig

#

hm