Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request From: munnari!sirius.ua.oz.au!gtravan@uunet.uu.net (George Travan) Newsgroups: comp.sys.sun Subject: VAX SUN binary conversions Keywords: Software Message-ID: <89@brazos.Rice.edu> Date: 6 Jul 89 03:50:37 GMT Sender: root@rice.edu Organization: Sun-Spots Lines: 22 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 8, Issue 68, message 14 of 22 I have a need to convert vax floating point numbers to sun ieee format. problem is the routine : union ie3float { char c[4]; int exp; float f; }; void vf2ie3f(u,n) register union ie3float *u; register int n; { /* VAX float to IEEE float */ register char tmp; register int i; for(i=0; iexp) continue; tmp=u->c[0]; u->c[0]=u->c[1]-1; u->c[1]=tmp; tmp=u->c[2]; u->c[2]=u->c[3]; u->c[3]=tmp; } } when passed a pointer to data such as 0x80400000 which corresponds to vax 0x00004080 = 1.0 doesnt give me the right answer on my SUN 3/60. i get -1369117816400609700000000000000000000000.000000 (??) can you see anything here that i cant? /GeO ACSnet: gtravan@sirius.ua.oz