New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replacing the word 'mantissa' with 'significand' when appropriate in Chapel documentation #19282
Comments
There is no concept of a mantissa in a real(w) floating point number these days, certainly not in those defined by the IEEE 754 standard that Chapel supports and pretty well all of today's CPUs implement (mostly fully). Specifically: ... Replace every occurrence of _mant(w)+1+ in the table with prec(w), and of mant(w) by prec(w)-1 where w is The function prec(w) is the number of binary digits in the significand of the w-bit floating-point type including the implicit hidden bit which is always 1 and is not stored in the bit pattern. This is 24 for a real(32) and 53 with real(64). If Chapel ever implements the 80-bit IEEE 754 extended point type, that definition will need to change. Hopefully, 128-bit floating point comes along before that ever becomes a necessary and saves humanity. |
I'm almost certainly responsible for the occurrence in NPBRandom.chpl, though in my defense, the context for that occurrence is a direct quote from the NPB code itself. This seems like one of those classic cases of "preserve the quote because that's the quote said" vs. "correct the quote itself". A hybrid solution would be to follow up the quote with a statement of clarification. |
The developer who introduced "mantissa" into the spec no longer works for us, so I can't tag them here as intended. @mppf, you seem to have used the term within the compiler recently and less recently. Any thoughts here? |
I often fall back on 'mantissa' when I really want to say signed significand. Even C's library is messy.
This is the reverse. Here, the routine is returning the signed significand, not the actual significand which has magnitude only. The word |
@damianmoz - I often use Wikipedia to answer the question of what people mean when using a particular term. https://en.wikipedia.org/wiki/Significand#Terminology acknowledges that it is common for computer scientists to use the term "mantissa" but also lists some experts saying we should really be using "significand" and includes a justification for why significand is a better term. Which is pretty much what is happening right here right now :) While I am open to using Anyway, if we want to rely on IEEE 754 to define the floating point operations, we should be using consistent terminology with it. So, maybe the spec should say something like "significand, sometimes called mantissa" so that people could find it if "mantissa" was the term familiar to them. |
I like your wise idea (with spelling corrected) of
If such a flash of wisdom had hit my brain at the time, I would have suggested it myself. But sadly not. Mantissa has a less strict definition. Significand as the IEEE 754 standard has a very strict definition, what the Wikipedia article calls the normalized significand, and is unsigned. Mind you, C's library routine Either way, if you want to say that mantissa are the same, the formula is still out by 1. So my point holds. If you are saying that the mantissa is the significand without the leading hidden bit, then the existing formula is correct. I updated my spelling dictionary ages ago to include |
In
The word
mantissa
is used where it really means the IEEE 754 concept of significand. There is an implied function mant(t) which is trying to return the number of digits in this incorrectly namedmantissa
.Does anybody have any suggestions on rewording this to be more IEEE 754 compliant before I make my take on it?
It is also called mantissa in NPBRrandom, which again is the wrong term.
The text was updated successfully, but these errors were encountered: