[LLVMdev] APFloat renaming isNormal => isFiniteNonZero and isIEEENormal => isNormal

Michael Gottesman mgottesman at apple.com
Tue Jun 18 15:45:39 PDT 2013


IEEE-754R defines a normal floating point number as:
2.1.38 normal number: For a particular format, a finite non-zero floating-point number with magnitude greater than or equal to a minimum bemin value, where b is the radix. Normal numbers can use the full precision available in a format. In this standard, zero is neither normal nor subnormal. 

This implies that a denormal is not a normal number.

In contrast, the current implementation of isNormal in APFloat does treat denormal numbers as normal numbers breaking this definition. This is not just a predicate that has a name that differs from IEEE-754R (which I am fine with), but is an actual name collision with IEEE-754R with a different semantic meaning. This could easily lead to programmer error and thus in my humble opinion is worth the hassle/trouble of fixing.

Does anyone have any thoughts/suggestions/objections with my renaming isNormal => isFiniteNonZero (and making all the relevant changes in the relevant codebases) and isIEEENormal => isNormal?

Awaiting the flames,
Michael


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130618/815e2861/attachment.html>


More information about the llvm-dev mailing list