<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>2642</bug_id>
          
          <creation_ts>2006-01-05 13:12:04 +0000</creation_ts>
          <short_desc>Value space for xs:float is incorrect</short_desc>
          <delta_ts>2006-03-09 00:13:12 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XML Schema</product>
          <component>Datatypes: XSD Part 2</component>
          <version>1.0/1.1 both</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>resolved</keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="C. M. Sperberg-McQueen">cmsmcq</assigned_to>
          
          
          <qa_contact name="XML Schema comments list">www-xml-schema-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>7621</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-01-05 13:12:05 +0000</bug_when>
    <thetext>The value space for xs:float is described in both 1.0 and 1.1 as

The basic ·value space· of float consists of the values m × 2^e, where m is an
integer whose absolute value is less than 2^24, and e is an integer between -149
and 104, inclusive. 

This is incorrect: it would require 33 bits to represent this value space. In
fact, single precision floating point allocates 1 bit for the sign, 8 bits for
the exponent, and 23 bits for the (unsigned) mantissa. The description should read:

The basic ·value space· of float consists of the values m × 2^e, where m is an
integer whose absolute value is less than 2^23, and e is an integer between -149
and 104, inclusive.

Michael Kay</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7636</commentid>
    <comment_count>1</comment_count>
    <who name="Dave Peterson">davep</who>
    <bug_when>2006-01-05 17:17:22 +0000</bug_when>
    <thetext>(In reply to comment #0)

&gt; The basic ·value space· of float consists of the values m × 2^e, where m is an
&gt; integer whose absolute value is less than 2^24, and e is an integer between -149
&gt; and 104, inclusive. 
&gt; 
&gt; This is incorrect: it would require 33 bits to represent this value space. In
&gt; fact, single precision floating point allocates 1 bit for the sign, 8 bits for
&gt; the exponent, and 23 bits for the (unsigned) mantissa. The description should read:
&gt; 
&gt; The basic ·value space· of float consists of the values m × 2^e, where m is an
&gt; integer whose absolute value is less than 2^23, and e is an integer between -149
&gt; and 104, inclusive.

No, the description is correct.  Because float and double do not carry variable
precision, ANSI/IEEE 754 was able to design the bit layout so that for &quot;normal&quot;
numbers, there is an implied 1 bit tacked onto the unsigned m.  (BTW, &quot;mantissa&quot;
is the wrong word; the mantissa is the fractional part of the log of m.)  For &quot;subnormal&quot;
numbers, the extra 1 bit is not tacked on; this allows filling in the region between
zero and the smallest &quot;normal&quot; number.  &quot;Normal&quot; in this sense means that the
number is expressible with an m and e such than  2^23 &lt;= m  (in addition to the
general requirement of  0 &lt; m &lt; 2^24  and  -149 &lt;=e &lt;= 104 ).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>8641</commentid>
    <comment_count>2</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2006-03-09 00:13:12 +0000</bug_when>
    <thetext>Having examined this issue in some detail, I can confirm that 
Dave Peterson&apos;s response is accurate.  As part of a general
cleanup of the datatypes issues, I&apos;m going to close this
marked WORKSFORME.  Michael, if you are unsatisfied with this
resolution, please let us know.  Thanks.

</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>