Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
NoBl committed Jul 22, 2024
1 parent f3cbe4d commit 33ef7e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ const HexToFloat32 = (str) => {
// var sign = (int >>> 31) ? -1 : 1;
const sign = int & 0x80000000 ? -1 : 1;
let exp = ((int >>> 23) & 0xff) - 127;
const mantissa = ((int & 0x7fffff + 0x800000).toString(2);
const mantissa = ((int & 0x7fffff) + 0x800000).toString(2);
let float32 = 0;
for (let i = 0; i < mantissa.length; i++) {
float32 += parseInt(mantissa[i]) ? Math.pow(2, exp) : 0;
Expand Down

0 comments on commit 33ef7e4

Please sign in to comment.