GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  NTOHD (3)

.ds Aq ’

NAME

htond, ntohd - convert double-precision floating point numbers between host and network format and byte order

CONTENTS

SYNOPSIS

htond(netptr, hostptr, count);

unsigned char *netptr;
unsigned char *hostptr;
int count;


ntohd(hostptr, netptr, count);

unsigned char *hostptr;
unsigned char *netptr;
int count;

DESCRIPTION

These routines are used for conversion between the local host 64-bit ("double precision") representation, and 64-bit IEEE double precision representation, in "network order", i.e., big-endian, the MSB in byte [0], on the left.

As a quick review, the IEEE double precision format is as follows: sign bit, 11 bits of exponent (bias 1023), and 52 bits of mantissa, with a hidden leading one (0.1 binary). When the exponent is 0, IEEE defines a "denormalized number", which is not supported here. When the exponent is 2047 (all bits set), and: all mantissa bits are zero, value is infinity*sign, mantissa is non-zero, and: msb of mantissa=0: signaling NAN msb of mantissa=1: quiet NAN

Note that neither the input or output buffers need be word aligned, for greatest flexibility in converting data, even though this may impose a speed penalty on some architectures.

These subroutines operate on a sequential block of numbers, to save on subroutine linkage execution costs, and to allow some hope for vectorization.

On brain-damaged machines like the SGI 3-D, where type "double" allocates only 4 bytes of space, these routines *still* return 8 bytes in the IEEE buffer.

SEE ALSO

htons(3N), ntohs(3N), htonl(3N), ntohl(3N)

BUGS

The VAX handles bytes backwards from most everyone else in the world. This is not expected to be fixed in the near future.

AUTHOR

BRL-CAD Team

COPYRIGHT

This software is Copyright (c) 1988-2013 by the United States Government as represented by U.S. Army Research Laboratory.

BUG REPORTS

Reports of bugs or problems should be submitted via electronic mail to <devs@brlcad.org>.

Search for    or go to Top of page |  Section 3 |  Main Index


BRL-CAD HTOND (3) 04/04/2016

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.