KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a piece of Javascript code I'm trying to understand // read big-endian (network byte order) 32-bit float readFloat32 = function(data, offset) { var b1 = data.charCodeAt(offset) & 0xFF, b2 = data.charCodeAt(offset+1) & 0xFF, b3 = data.charCodeAt(offset+2) & 0xFF, b4 = data.charCodeAt(offset+3) & 0xFF; var sign = 1 - (2*(b1 >> 7)); //<--- here it is and 2 lines below var exp = (((b1 << 1) & 0xff) | (b2 >> 7)) - 127; var sig = ((b2 & 0x7f) << 16) | (b3 << 8) | b4; if (sig == 0 && exp == -127) return 0.0; return sign * (1 + sig * Math.pow(2, -23)) * Math.pow(2, exp); } what does ">>" mean? Is it a special type of boolean (like '<' or '>')
Tags (comma-separated)
Save Edits
Cancel