Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
IBM hexadecimal floating-point
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Example === Consider encoding the value β118.625 as an HFP single-precision floating-point value. The value is negative, so the sign bit is 1. The value 118.625<sub>10</sub> in binary is 1110110.101<sub>2</sub>. This value is normalized by moving the radix point left four bits (one hexadecimal digit) at a time until the leftmost digit is zero, yielding 0.01110110101<sub>2</sub>. The remaining rightmost digits are padded with zeros, yielding a 24-bit fraction of .0111 0110 1010 0000 0000 0000<sub>2</sub>. The normalized value moved the radix point two hexadecimal digits to the left, yielding a multiplier and exponent of 16<sup>+2</sup>. A bias of +64 is added to the exponent (+2), yielding +66, which is 100 0010<sub>2</sub>. Combining the sign, exponent plus bias, and normalized fraction produces this encoding: :{| |- style="text-align:center" |style="width:20px;text-align:center;background-color:#FC9"|S |style="width:90px;text-align:center;background-color:#99F"|Exp |style="width:250px;text-align:center;background-color:#9F9"|Fraction |style="text-align:center;background-color:#FFF"| |- style="text-align:center" |style="text-align:center;background-color:#FEC"|{{mono|1}} |style="text-align:center;background-color:#CCF"|{{mono|100 0010}} |style="text-align:center;background-color:#CFC"|{{mono|0111 0110 1010 0000 0000 0000}} |style="text-align:center;background-color:#FFF"| |} In other words, the number represented is β0.76A000<sub>16</sub> Γ 16<sup>66 β 64</sup> = β0.4633789β¦ Γ 16<sup>+2</sup> = β118.625
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)