3 ms·
IEEE decimal is definitely complicated and confusing, but it does seem to unambiguously be sign-magnitude? The confusing part is how the magnitude works, not h
by Sniffnoy 3y ago
IEEE decimal is definitely complicated and confusing, but it does seem to unambiguously be sign-magnitude? The confusing part is how the magnitude works, not how signedness works...
- o11c 3y agoThe weird interleaving of the exponent with the mantissa - and the existence of noncanonical values - means you can't just through them into sign-magnitude integer comparison routines.
- lifthrasiir 3y agoIsn't that interleaving is mainly used for making better use of bits? To me it is more like the limitation of exact power-of-two bit sizes, for example decimal40 (1 sign bit + 9 exponent bits + 30 mantissa bits) should have been not that bad. In comparison, decimal32 could have the following combinations: s e m 1 11 20 - 6 mantissa digits, exponent range too large (~10^+/-1000) 1 7 24 - 7 mantissa digits, exponent range too small (~10^+/-60) 1 7.6 23.3 - still 7 mantissa digits, but interleaving gives exponent range of ~10^+/-90 1 4 27 - 8 mantissa digits, exponent range too small to even contain binary32 1 1 30 - 9 mantissa digits but no usable exponent range I guess it is not the worst trade-off. Your point about non-canonical values is entirely valid though. I do know it is mostly due to the expensive normalization step, but that only sounds like a reason to always prefer DPD---there is little reason to define a decimal FP standard if it is not for hardwares nowadays.
- Sniffnoy 3y agoAh, I see. By "sign-magnitude" I just meant that the sign and the magnitude are stored independently, and I think that's the usual usage of the term; I wouldn't expect "a sign-magnitude format" to mean one where you can use sign-magnitude integer comparison.