Editing IEEE 754
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.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 44: | Line 44: | ||
====Signed zero==== | ====Signed zero==== | ||
Note that there are two possible representations for zero. The one in which the sign bit is 0 is called ''positive zero'', and the one in which the sign bit is 1 is called ''negative zero''. The following rules apply: | Note that there are two possible representations for zero. The one in which the sign bit is 0 is called ''positive zero'', and the one in which the sign bit is 1 is called ''negative zero''. The following rules apply: | ||
− | * Positive zero and negative zero compare equal | + | * Positive zero and negative zero compare equal. |
* When multiplying two numbers, at least one of which is zero, the signs are also multiplied; for example, multiplying positive zero by any negative value (except negative infinity) gives negative zero. | * When multiplying two numbers, at least one of which is zero, the signs are also multiplied; for example, multiplying positive zero by any negative value (except negative infinity) gives negative zero. | ||
* Likewise, when dividing zero by a nonzero number, the signs are also divided. This is true even when the divisor is infinite. | * Likewise, when dividing zero by a nonzero number, the signs are also divided. This is true even when the divisor is infinite. | ||
Line 51: | Line 51: | ||
* (-0) + (-0) = (-0) - (+0) = -0 | * (-0) + (-0) = (-0) - (+0) = -0 | ||
* (+0) + (-0) = (-0) + (+0) = (+0) - (+0) = (-0) - (-0). They are all equal to +0, except in ''round toward negative infinity'' mode, in which case they all equal -0. In fact, the same is true of <math>x - x</math> or <math>x + (-x)</math>, for any real <math>x</math>. | * (+0) + (-0) = (-0) + (+0) = (+0) - (+0) = (-0) - (-0). They are all equal to +0, except in ''round toward negative infinity'' mode, in which case they all equal -0. In fact, the same is true of <math>x - x</math> or <math>x + (-x)</math>, for any real <math>x</math>. | ||
− | * The | + | * The square root of -0 is -0. |
===Summary=== | ===Summary=== |