Skip to content Skip to sidebar Skip to footer

Javascript: How To Convert Signed Char Array To Float (maybe Using Ieee754)?

I struggle with the result of my nodejs-JDBC-MSSQL-Binary-ResultValue. From my database I've got this [-78,119,99,63] // this is an array of signed Chars In hex, 0xB2, 0x77, 0x6

Solution 1:

You can use "typed arrays":

var chars = new Uint8Array([-78, 119, 99, 63])
var floats = new Float32Array(chars.buffer)
> [0.8885451555252075]

Post a Comment for "Javascript: How To Convert Signed Char Array To Float (maybe Using Ieee754)?"