views:

69

answers:

1

Hello, I don't know how to do two somewhat related task within vbscript (not vb) -I need to break a 32 bit floating point into it's 4 byte binary representation. -I need to break a 32 bit floating point into it's 2 word(aka16bit) binary representation.

For example, 65535.0 in format binary is 1000111011111111111111100000000 65535.0 in format hex is 477Fff00 65535.0 in format byte is 71, 127, 255, 0 65535.0 in format word is 18303, -256 [the last two is what i want to do]

reference: http://babbage.cs.qc.edu/IEEE-754/32bit.html

A: 

See http://stackoverflow.com/questions/3077718 for the solution in JavaScript. It shouldn't be too difficult to translate the code into Visual Basic.

Roland Illig