Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: goldstn@evax.arl.utexas.edu (David Goldstein)
Subject: Problems with ntohs
Date: 18 Feb 91 23:17:46 GMT	[thread overview]
Message-ID: <1991Feb18.231746.20132@evax.arl.utexas.edu> (raw)

I have run into a seemingly insurmountable problem when communicating
between DEC (Ultrix) and Sun machines using TCP/IP.  The two machines
reverse bytes, which is handled by the ntohs, ntohl commands.  However,
I have an application sending floats.  Interestingly, if one does:

printf("The value should be %f",ntohs(x));   

then one gets a sort-of reasonable, predictable answer.  However, if one
does:

x = ntohs(x);
printf("x is now %f",x);

then one realizes that the Vax SEEMS to do some funny things with the
high order bits, transforming a very small number into an incorrect,
large one....
any experiences or suggestions on surmounting this would be
appreciated! thanks!
david


             reply	other threads:[~1991-02-18 23:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-02-18 23:17 David Goldstein [this message]
  -- strict thread matches above, loose matches on Subject: below --
1991-02-19 22:38 Problems with ntohs David Warren
1991-02-20  1:54 ` Fletcher Kittredge
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox