1998Q4/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Network float format (RFC 1014) -->
<!--X-From-R13: X Q Znjerapr <pynjNxnatn.ah> -->
<!--X-Date: Wed, 14 Oct 1998 22:42:11 &#45;0700 -->
<!--X-Message-Id: E0zTgAt&#45;0004nJ&#45;00#mail,kanga.nu -->
<!--X-Content-Type: text/plain -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] Network float format (RFC 1014)</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:claw#kanga,nu">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00214.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00216.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00327.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00210.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00215">Author</A>
&nbsp;|&nbsp;<A HREF="#00215">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00215">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] Network float format (RFC 1014)</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Subject</em>: [MUD-Dev] Network float format (RFC 1014)</LI>
<LI><em>From</em>: J C Lawrence &lt;<A HREF="mailto:claw#kanga,nu">claw#kanga,nu</A>&gt;</LI>
<LI><em>Date</em>: Wed, 14 Oct 1998 22:42:10 -0700</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>

Some time back there was a thread on the network format to use for
floating point values (Ben?), with the observation that there was not
equivalent to htonl() for such.  The concern was for implementing
client protocols where coordinate data exchanges might enclude
floating point values.

RFC 1014, "XDR: External Data Representation Standard" which can be
found at

  <A  HREF="http://www.pasteur.fr/other/computer/RFC/10xx/1014">http://www.pasteur.fr/other/computer/RFC/10xx/1014</A>

has some to say on this area, and in fact addresses the general area
of transmission formats rather thoroughly:

--&lt;cut&gt;--

3.6 Floating-point

   The standard defines the floating-point data type "float" (32 bits or
   4 bytes).  The encoding used is the IEEE standard for normalized
   single-precision floating-point numbers [3].  The following three
   fields describe the single-precision floating-point number:

      S: The sign of the number.  Values 0 and 1 represent positive and
         negative, respectively.  One bit.

      E: The exponent of the number, base 2.  8 bits are devoted to this
         field.  The exponent is biased by 127.

      F: The fractional part of the number's mantissa, base 2.  23 bits
         are devoted to this field.

   Therefore, the floating-point number is described by:

         (-1)**S * 2**(E-Bias) * 1.F

   It is declared as follows:
         float identifier;

         +-------+-------+-------+-------+
         |byte 0 |byte 1 |byte 2 |byte 3 |              SINGLE-PRECISION
         S|   E   |           F          |         FLOATING-POINT NUMBER
         +-------+-------+-------+-------+
         1|&lt;- 8 -&gt;|&lt;-------23 bits------&gt;|
         &lt;------------32 bits------------&gt;

   Just as the most and least significant bytes of a number are 0 and 3,
   the most and least significant bits of a single-precision floating-
   point number are 0 and 31.  The beginning bit (and most significant
   bit) offsets of S, E, and F are 0, 1, and 9, respectively.  Note that
   these numbers refer to the mathematical positions of the bits, and
   NOT to their actual physical locations (which vary from medium to
   medium).

   The EEE specifications should be consulted concerning the encoding
   for signed zero, signed infinity (overflow), and denormalized numbers
   (underflow) [3].  According to IEEE specifications, the "NaN" (not a
   number) is system dependent and should not be used externally.

--&lt;cut&gt;--

With further text on doubles, fixed lenth arrays, variable length
arrays, unions, structures, defined types etc.

-- 
J C Lawrence                               Internet: claw#kanga,nu
----------(*)                             Internet: coder#kanga,nu
...Honourary Member of Clan McFud -- Teamer's Avenging Monolith...


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00214.html">[MUD-Dev] Re: Trusting the Client (Re: Laws of Online World Design)</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00216.html">[MUD-Dev] Re: [Tech] socket slowdown solved</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00327.html">[MUD-Dev] Re: Bruce Sterling on Virtual Community goals</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00210.html">[MUD-Dev] ADMIN: unsubscriptions</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00215"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00215"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>[MUD-Dev] Re: Bruce Sterling on Virtual Community goals</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="00246" HREF="msg00246.html">[MUD-Dev] Re: Bruce Sterling on Virtual Community goals</A></strong>, 
Jon Leonard <a href="mailto:jleonard#divcom,slimy.com">jleonard#divcom,slimy.com</a>, Mon 19 Oct 1998, 18:49 GMT
<UL>
<LI><strong><A NAME="00277" HREF="msg00277.html">[MUD-Dev] Re: Bruce Sterling on Virtual Community goals</A></strong>, 
Elis Pomales <a href="mailto:pomales#caip,rutgers.edu">pomales#caip,rutgers.edu</a>, Tue 20 Oct 1998, 18:31 GMT
<UL>
<LI><strong><A NAME="00299" HREF="msg00299.html">[MUD-Dev] Re: Bruce Sterling on Virtual Community goals</A></strong>, 
Darrin Hyrup <a href="mailto:shades#mythicgames,com">shades#mythicgames,com</a>, Wed 21 Oct 1998, 15:06 GMT
<UL>
<LI><strong><A NAME="00327" HREF="msg00327.html">[MUD-Dev] Re: Bruce Sterling on Virtual Community goals</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Thu 22 Oct 1998, 01:16 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</ul>
</ul>
</ul>
</LI>
<LI><strong><A NAME="00215" HREF="msg00215.html">[MUD-Dev] Network float format (RFC 1014)</A></strong>, 
J C Lawrence <a href="mailto:claw#kanga,nu">claw#kanga,nu</a>, Thu 15 Oct 1998, 05:42 GMT
<LI><strong><A NAME="00210" HREF="msg00210.html">[MUD-Dev] ADMIN: unsubscriptions</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Wed 14 Oct 1998, 22:30 GMT
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00358" HREF="msg00358.html">[MUD-Dev] ADMIN: Unsubscriptions</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Thu 22 Oct 1998, 18:07 GMT
</LI>
<LI><strong><A NAME="00673" HREF="msg00673.html">[MUD-Dev] ADMIN: Unsubscriptions</A></strong>, 
J C Lawrence <a href="mailto:claw#kanga,nu">claw#kanga,nu</a>, Sun 01 Nov 1998, 17:34 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00207" HREF="msg00207.html">[MUD-Dev] Re: Trusting the Client (Re: Laws of Online WorldD esign)</A></strong>, 
Wilburn, E.J. <a href="mailto:WilburnE#kochind,com">WilburnE#kochind,com</a>, Wed 14 Oct 1998, 20:45 GMT
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>