Skip to content
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

"Exponent", "Coefficient", "Significand", and "Normal" not well-defined #114

Open
waldemarhorwat opened this issue Apr 4, 2024 · 2 comments

Comments

@waldemarhorwat
Copy link

The proposal relies on the word "exponent" from IEEE 754, but the word "exponent" is not well-defined in my copy of that standard. IEEE 754 has several numerically different concepts all called "exponent" and uses different wording depending on which one it's referring to. Just referring to "exponent" without saying which one is not meanigful.

The proposal defines "normal" as:

A Decimal128 value is said to be normal if its coefficient either (zero and has an exponent of zero) or has an exponent that is not divisible by ten.

I can't parse that sentence and objectively it makes no sense. 1e11 is normal, but 1e10 is not? "Coefficient" is not defined. How can a coefficient have an exponent of zero?

I presume "coefficient" is referring to "significand", but just like the word "exponent", IEEE 754 has multiple numerically different notions of what a significand is, so just referring to "significand" without saying which one is not meanigful.

@jessealama
Copy link
Collaborator

The terminology is indeed regrettably sloppy. Thanks. I do mean "significand". I'll take a closer look at the spec and see if I can pick a disambiguating definition. At a minimum, I'm happy to add some examples of how the term should be understood in the proposal spec.

@Protonk
Copy link

Protonk commented Jun 1, 2024

FYI the 754-2019 standard defines exponent as "The component of a finite floating-point representation that signifies the integer power to which the radix is raised in determining the value of that floating-point representation. The exponent e is used when the significand is regarded as an integer digit and fraction field, and the exponent q is used when the significand is regarded as an integer; e = q + p − 1 where p is the precision of the format in digits." p. 14 § 2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants