🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.ultrix
Article #7329

unix-ultrix VAX-IEEE number conversions

#7329
From: Tom Kozon
Date: Thu, 28 Jan 1993 20:11
26 lines
1938 bytes
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
Technical Details
Message-ID: <1993Jan28.201135.25383@eos.arc.nasa.gov>
Path: arc1-ca.pugleaf.net!sparky!uunet!scifi!acheron!philabs!linus!agate!ames!eos!kozon

Show Full Headers
Complete Article Headers
Newsgroups: comp.unix.ultrix,comp.sys.dec,comp.lang.c
Path: arc1-ca.pugleaf.net!sparky!uunet!scifi!acheron!philabs!linus!agate!ames!eos!kozon
From: kozon@eos.arc.nasa.gov (Tom Kozon)
Subject: unix-ultrix VAX-IEEE number conversions
Message-ID: <1993Jan28.201135.25383@eos.arc.nasa.gov>
Organization: NASA Ames Research Center
Distribution: usa
Date: Thu, 28 Jan 1993 20:11:35 GMT
Lines: 26