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

bikeshed: use "subnormal" instead of "denormal"? #3105

Closed
StefanKarpinski opened this issue May 14, 2013 · 13 comments
Closed

bikeshed: use "subnormal" instead of "denormal"? #3105

StefanKarpinski opened this issue May 14, 2013 · 13 comments
Labels
breaking This change will break code needs decision A decision on this change is needed

Comments

@StefanKarpinski
Copy link
Member

"Subnormal" seems to be the preferred newer term for "denormal" and certainly is more intuitive. Should we change our terminology to be a bit more modern or is "denormal" still the standard nomenclature?

@JeffBezanson
Copy link
Member

Is there a reference for this?
I see APIs out there using both issubnormal and isdenormal. We can change if there is some evidence subnormal is preferred.

@pao
Copy link
Member

pao commented May 15, 2013

The SSE floating point control flag DZ uses (you guessed it) "denormal". But SSE isn't exactly a recent instruction set, either.

@bsxfan
Copy link

bsxfan commented May 28, 2013

Can one enable flushing of denormals to zero in Julia?

@bsxfan
Copy link

bsxfan commented May 28, 2013

Just found the answer here: #789.

ccall(:jl_zero_denormals, Bool, (Bool,), true)

@ViralBShah
Copy link
Member

We should probably have a better interface and document it as well.

@pao
Copy link
Member

pao commented May 28, 2013

Yeah, I never got that far. Agree on both points; should that be opened as a new issue?

@ViralBShah
Copy link
Member

I guess this issue will get closed after the bikeshed, but we still need a better way to provide this capability, and document it - so perhaps a new issue is a good idea.

@simonbyrne
Copy link
Contributor

The IEEE 754-2008 standard uses the term subnormal.

@StefanKarpinski
Copy link
Member Author

That kind of clinches it for me – "subnormal" is both more intuitive and what the IEEE 754 spec uses, so it seems to be the term for this going forward. Let's be forward-looking and use "subnormal". The rest of the Internet, however – including Wikipedia – doesn't quite seem to have caught up with this new and improved nomenclature though.

@JeffBezanson
Copy link
Member

Ok, if the new IEEE standard uses it then let's use it.

@bsxfan
Copy link

bsxfan commented May 29, 2013

Is 0.0 subnormal? A salient feature of subnormals is that they make computation slow. Zeros do not.

Wikipedia says: "In computer science, denormal numbers or denormalized numbers (now often called subnormal numbers) fill the underflow gap around zero in floating-point arithmetic. Any non-zero number with magnitude smaller than the smallest normal number is 'subnormal'."

But later it says: "The denormal floats are a linearly-spaced set of values which span the gap between the negative and positive normal floats."

julia> isdenormal(0.0)
true 

@StefanKarpinski
Copy link
Member Author

I'm pretty sure that's a bug – 0.0 and -0.0 should not be considered subnormal.

@JeffBezanson
Copy link
Member

Zero is "non-normal" in the sense that it does not use the usual 1.m normalized representation. However, I'm pretty sure subnormals are identified with gradual underflow, making zero its own special case and not a subnormal number. A slow implementation is not part of the definition :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This change will break code needs decision A decision on this change is needed
Projects
None yet
Development

No branches or pull requests

6 participants