Document: WG14 N1428
Submitter: Fred J. Tydeman (USA)
Submission Date: 2009-12-01
Background: As a function that maps reals to reals, sqrt(-1.0) has no usefully definable result, and the operand is invalid, so is a domain error. In like vain, as a function that maps reals to integers, ilogb(0.0) has no usefully definable result, so it should be a domain error. In addition, IEEE-754-2008 requires ilogb(NaN or infinity or 0) to raise invalid.
Add to F.9.3.5 the ilogb functions a new bullet:
-- ilobg(x), for x being a NaN, infinity, or zero, is a domain error and raises the "invalid" floating-point exception.
-- ilobg(x) raises the "invalid" floating-point exception for x being a NaN, infinity, or zero.
For either case, add to that same paragraph: The return value is specified in 22.214.171.124.
Add to Raionale:
logb() was specified (in an appendix) in IEEE-754-1985. ilobg(x) was added to IEEE-754-2008, and both were moved to the main body and made into required functions. Since integer types do not have representations of NaN or infinity, ilogb(x) for x being a NaN, infinity, or zero, are required to raise invalid (as if those were a domain error).