From sources-request at octave dot org Tue Jun 1 03:34:23 2004 Subject: VAX<-->IEEE 32bit float conversion From: Wolfgang Westphal To: sources at octave dot org Date: Tue, 1 Jun 2004 10:32:48 +0200 --Boundary-00=_w8DvApaxnh+X0o2 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi! I had to read some data files containing float values in VAX notation, so I've implemented the conversion for 32bit VAX floats to IEEE little endian. AFAIK for the 32bit case there's no difference between "VAX-D" and "VAX-G", so the conversion is identical in both cases. The attached patch is tested in octave 2.1.50 as well as octave 2.1.57, and worksforme. Regards, Wolfgang Westphal --Boundary-00=_w8DvApaxnh+X0o2 Content-Type: text/x-diff; charset="iso-8859-1"; name="vaxieee.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="vaxieee.diff" --- liboctave/data-conv.cc 2002-04-10 02:39:51.000000000 +0200 +++ liboctave/data-conv.cc 2004-05-31 13:10:14.000000000 +0200 at @ -277,15 +277,26 @@ } static void -VAX_D_float_to_IEEE_little_float (float * /* d */, int /* len */) +VAX_D_float_to_IEEE_little_float (float * d, int len) { - gripe_data_conversion ("VAX D float", "IEEE little endian format"); + for (int i=0;i