GNOME Bugzilla – Bug 726464
test t6501-numbers fails
Last modified: 2014-03-17 17:50:37 UTC
Hi- Minor issue --- the test t6501-numbers fails, computing log2(1) = -3.35018471298021E-17 (which is, of course, very close to 0, but not quite). glibc on my system gets it right, both using its log2 () call and using frexp () and log () as your source code does. Thanks for your attention. -Andrew Warshall
Are you sure you have re-compiled the math plugin? The log code was changed recently. Can you add print statements to gnm_log2 in mathfunc.c to see the values of x and e?
I added printf ("x = %a, e = %d\n", x, e); to gnm_log2() just before the return... line and recompiled Now, when computing log2(1), I get on stdout x = 0x1p-1, e = 1 which is what it should be (if I'm understanding the source code correctly), but gnumeric still computes the same answer as before (-3.35018471298021E-17). -Andrew Warshall
Well, in hindsight that was obvious. The whole idea was to get x==1 in there, but we get 0.5 Please try adding this after the gnm_frexp call: if (x == 0.5) x = 1.0, e--;
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.