From: kozon@eos.arc.nasa.gov (Tom Kozon)
Subject: unix-ultrix VAX-IEEE number conversions
Date: Thu, 28 Jan 1993 20:11:35 GMT [thread overview]
Message-ID: <1993Jan28.201135.25383@eos.arc.nasa.gov> (raw)
Hello,
I am currently in the process of porting some software from
one system (DEC VAX 785 running BSD 4.3 unix) to another (Decsystem
5100 running ULTRIX RISC V4.2). Some of this software has the function of
reading a binary stream of VAX data. While integer data types are read on
the Decsystem with no difficulties, I am finding that I will need to
convert floating point and double precision numbers from VAX into IEEE
format. So far, I've written a couple of standalone test programs (running
on the Decsystem) using the C library functions developed to do these
conversions. I've been able to successfully use " ftoi " to make accurate
floating point conversions with no problems. However, the function that
transforms the double precision numbers (i.e., " dtoi ") seems to present
some special difficulties. In general, it seems to convert a VAX double
precision number into its IEEE format (mostly, but sometimes not), but
almost never returns a " 0 " integer value indicating the conversion
has been successfully made. According to the on-line documentation, if
this function returns a non-zero value, it does not do the conversion.
So, why would my experience be accurate transformations with nonzero
function return values? The C program that uses dtoi generally works
in the same manner as the one using ftoi, so these results seem surprising.
Any suggestions/clues on this matter would be greatly appreciated --
thanks in advance for posted and/or E-mail replies!
Tom
kozon@eos.arc.nasa.gov
reply other threads:[~1993-01-28 20:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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