problem with numericalio: it writes 4 byte "unknowns" instead of 8 byte IEEE DP
Subject: problem with numericalio: it writes 4 byte "unknowns" instead of 8 byte IEEE DP
From: Stavros Macrakis
Date: Sat, 29 Sep 2012 11:29:18 -0400
Dragan,
Thanks for the bug report. I confirm that this problem occurs in Maxima
5.28.0-2. I also tested in Maxima 5.25.1, where I got what I believe is
the correct answer:
00000000: 3fe0 0000 0000 0000 3ff0 0000 0000 0000
00000010: 4000 0000 0000 0000 3ff9 21fb 5444 2d18
00000020: 4009 21fb 5444 2d18 3ff0 0000 0000 0000
It looks as though there have been some changes in numericalio and
encode-decode-float.lisp which caused this problem.
Until this is fixed, you could either use the numericalio routines from
5.25 or simply run Maxima 5.25.
Please also file a bug report at sourceforge. Thanks!
-s
On Sat, Sep 29, 2012 at 5:00 AM, drgst web de <drgst at web.de> wrote:
> Dear all,
>
> in my understanding, the manpage
>
> http://maxima.sourceforge.net/docs/manual/de/maxima_63.html
>
> states that the binary output produced by "write_binary_data" consists
> of 8 byte floats that are commonly referred to as "IEEE 754 double
> precision". When the following script:
>
> load("numericalio");
> assume_external_byte_order:msb;
> a:1.0;b:2.0;ip:float(%pi);
> lst:[a/b,a,b,ip/b,ip,a];
> write_binary_data(lst,"filename goes in here");
>
> is executed on a system described by :
>
> build_info("5.28.0-2","2012-08-27 23:16:48","i686-pc-mingw32","GNU
> Common Lisp (GCL)","GCL 2.6.8")
>
> the output file looks like this when displayed in a hex editor:
>
> 30 80 00 00 31 00 00 00 31 80 00 00 31 44 2D 18 31 C4 2D 18 31 00 00
> 00
>
> Obviously, this is a binary file comprising 4 byte data instead of 8
> byte floats; this is confirmed by the OS file manager stating is
> comprises 24 bytes. The values do not correspond to IEEE 754 single
> precision floats either, as these would read:
>
> 3F 00 00 00 3F 80 00 00 40 00 00 00 3F C9 0F DB 40 49 0F DB 3F 80 00
> 00
>
> So I guess numericalio's output gives some 4 byte integers, perhaps
> the numerators of the internal representation by fractions??? I'm
> confused... can somebody please comment on this...
>
> Regards
> Dragan
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>