Howdy -
I built an Excel 2010 VBA application using the great FAQ routines on this forum at:
These convert IEEE 32 bit hex values to/from single (or double?) precison Excel numbers. I tried both single (32bit) and double (64 bit). I might be doing something wrong, but most times the Function i3efp(num_in) under FAQ Item # 4 works perfectly. When I say perfectly I mean it matches what I get from a nice on-line web based conversion utility at:
I find i3efp() works great for passed in values like 30, 35.5, 45, 50, and 59.1234. However, I get a mismatch with the above web tool for numbers like 35.1 and 133. Then i3efp() fails for numbers like 32, 64, and 128.
When 32 comes in, the internal "e" becomes 132, and "f" becomes 0. An "f" of zero bombs out at the second line here:
f = (Abs(num_in) / (2 ^ (e - 127))) - 1 ' f becomes 0
f = 1 * Right(f, Len(f) - 2) ' bombs out
Am I doing something wrong? Anyone have a fix?
I have put a demo spreadsheet on MediaFire, an Excel 2010 XLSM at
Thanks in advance,
Vip77
I built an Excel 2010 VBA application using the great FAQ routines on this forum at:
These convert IEEE 32 bit hex values to/from single (or double?) precison Excel numbers. I tried both single (32bit) and double (64 bit). I might be doing something wrong, but most times the Function i3efp(num_in) under FAQ Item # 4 works perfectly. When I say perfectly I mean it matches what I get from a nice on-line web based conversion utility at:
I find i3efp() works great for passed in values like 30, 35.5, 45, 50, and 59.1234. However, I get a mismatch with the above web tool for numbers like 35.1 and 133. Then i3efp() fails for numbers like 32, 64, and 128.
When 32 comes in, the internal "e" becomes 132, and "f" becomes 0. An "f" of zero bombs out at the second line here:
f = (Abs(num_in) / (2 ^ (e - 127))) - 1 ' f becomes 0
f = 1 * Right(f, Len(f) - 2) ' bombs out
Am I doing something wrong? Anyone have a fix?
I have put a demo spreadsheet on MediaFire, an Excel 2010 XLSM at
Thanks in advance,
Vip77