Base WG Resolution Ref: bwg2000-001
Topic: ilogb return value when X == 0

This is an approved Base Working Group Resolution for XSH5.

Last update: 26 April,2000

								2000 #001


	Topic:			ilogb return value when X == 0
	Relevant Sections:	ilogb
	Spec:			XSH5

Resolution Request:

It appears as if we may have missed folding the spec updates
in for this problem which occurred in the Issue 4v2 spec.

For PIN4U.00037, this group ruled on ilogb:

This is indeed a grey area. The return value is in conflict with the
description, and also inconsistent with the definition of logb.
A PIN should be granted.
A future revision of the specification will correct the return
values as follows:

if X == 0   return -INT_MAX
if X == NaN  or +/-infinity, return INT_MAX

Issue 5 currently says that if X==0, return -INT_MIN.
Was this an update we missed ?

Resolution Response
The existing return value of -INT_MIN as stated in XSH5 is incorrect.

A future revision of the specification is expected to align with the c99 spec.

Return values of either -INT_MAX or INT_MIN are permitted for XSH5.


The interpretation quoted was against XSH4.  The resulting change in XSH5
was incorrect in that -INT_MIN should have been -INT_MAX according to
the interpretation.

C99 allows that if x is 0, then ilogb() returns FP_ILOGB0,
which shall either be INT_MIN or -INT_MAX, and if x is NaN, then ilogb()
returns FP_ILOGBNAN which shall either be INT_MAX or INT_MIN.
If x is infinity, ilogb() returns INT_MAX (unchanged in
either XSH4.2 or XSH5). Thus c99 allows the behavior described in both
XSH4 and the interpretation .

Circulated for review: Mar 8 2000
Updated: 30 March 2000
Approved: April 2000