Ethereal-dev: Re: [Ethereal-dev] Handling DOUBLES

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxx>
Date: Thu, 5 Apr 2001 13:38:46 -0700 (PDT)
> The proto_tree_add_item() function pulls the data from the tvbuff
> directly. That means that there has to be some universal
> double-precision floating point format that is used in protocols.
> 
> There is for integers, but we have to specify big-endian or
> little-endian
> (that's the reason for the "little_endian" argument to
> proto_tree_add_item()).
> 
> I'm not an expert in floating-point representations and how they're
> used on the wire for various protocols.

There isn't any truly universal format...

...but, at this point, most modern protocols that shove floating-point
numbers over the wire in a standard format (rather than the native
format) probably do so in IEEE format.  (I think the only major non-IEEE
floating point formats, these days, are:

	IBM S/360 format (also used, I think, in DG Novas and Eclipses
	and MVs), although the latest machines in that series (later
	S/390's, and zArchitecture machines) also include IEEE support
	in the instruction set;

	PDP-11 format (actually, I think PDP-11 single precision *might*
	be the same as IEEE single-precision, although the
	double-precision formats, as I remember, have different numbers
	of bits in the exponent and mantissa; the VAX added, I think, 2
	additional formats, but I forget whether they're IEEE or not -
	Alpha supports both IEEE and, for VAX-compatibility, the older
	formats);

	maybe some formats used by, say, Crays.

However, I don't know whether any protocols we'd dissect involve sending
stuff over the wire in those formats.)