math: LOG10 weak with gnumeric-LONG?, log10( 10000000 ) -> 7.000000000000000000**4**, why?
Have seen above producing a test fail with gnumeric-LONG, tried to dig down:
sheet: =log10( 10000000 )
-> '7', but if you widen the cell (format still general ):
-> 7.0000000000000000004 for all variants with log( x, 10 ), log10( 10^7 ) ...
[edit] masked out a longer detour I got into because my compiler works differently for
"log10l( 10000000 )"
versus
long double aL = 10000000;
"log10l( aL )"
error based on 'cheating' compiler - Click to expand
Request for help, same on other systems? Or single fail here?
same machine, C-code printf( "log10l( 10000000 ) : %.25LE\n", log10l( 10000000 ) );
-> log10l( 10000000 ) : 7.0000000000000000000000000E+00
also with all variants like '10000000L', '10000000.0L', pow( 10.0L, 7.0L ) ...
add. info:
compiled --with-long-double,
gnumeric-config.h: #define HAVE_LOG10L 1
gnumeric-features.h: #define HAVE_LOG10L 1
in general sheet handles long double precision,
calling chain IMHO:
gnumeric/plugins/fn-math/functions.c/gnumeric_log10:
-> gnm_log10,
gnumeric/src/numbers.h in '#ifdef GNM_WITH_LONG_DOUBLE' section:
#define gnm_log10 log10l
and that should be above C-code 'log10l', but I get different results in sheet,
snippets:
goffice not involved?
other logs / powers affected too, some, not all,
no such simple fails with gnumeric-double,
functions.c has math.h included, numbers.h hasn't,
I get 7.0000000000000000004 as result of log(10000000)/log(10),
but not for ln(10000000)/ln(10),
my system IS! pested with patches here, trials there, WIP all around,
but above fail is old, persistent, since long time in all long installations and versions,
also where I tried to produce / keep clean vanilla installations,
bt with =log10(10000000) in single cell:
^C
Thread 1 "gnumeric" received signal SIGINT, Interrupt.
0x00007ffff6c7f32f in __GI___poll (fds=0x55555571ae30, nfds=3, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
29 ../sysdeps/unix/sysv/linux/poll.c: No such file or directory.
(gdb) bt
#0 0x00007ffff6c7f32f in __GI___poll (fds=0x55555571ae30, nfds=3, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1 0x00007ffff6dd893e in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x00007ffff6dd8c7f in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3 0x00007ffff726e265 in gtk_main () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#4 0x0000555555557d50 in main (argc=<optimized out>, argv=<optimized out>) at main-application.c:343
bt breaking fill =log10(10000000) to the whole sheet:
^C
Thread 1 "gnumeric" received signal SIGINT, Interrupt.
_int_malloc (av=av@entry=0x7ffff6d75c60 <main_arena>, bytes=bytes@entry=2080) at ./malloc/malloc.c:4377
4377 ./malloc/malloc.c: No such file or directory.
(gdb) bt
#0 _int_malloc (av=av@entry=0x7ffff6d75c60 <main_arena>, bytes=bytes@entry=2080) at ./malloc/malloc.c:4377
#1 0x00007ffff6c17f7f in _int_memalign (av=av@entry=0x7ffff6d75c60 <main_arena>, alignment=alignment@entry=1024, bytes=bytes@entry=1008) at ./malloc/malloc.c:4963
#2 0x00007ffff6c1864a in _mid_memalign (alignment=alignment@entry=1024, bytes=bytes@entry=1008, address=<optimized out>) at ./malloc/malloc.c:3565
#3 0x00007ffff6c19c5f in __posix_memalign (size=1008, alignment=1024, memptr=0x7fffffffc960) at ./malloc/malloc.c:5685
#4 __posix_memalign (memptr=0x7fffffffc960, alignment=1024, size=1008) at ./malloc/malloc.c:5669
#5 0x00007ffff6df67e4 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6 0x00007ffff6df7416 in g_slice_alloc () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7 0x00007ffff7bcd8a7 in cell_new () at sheet.c:4632
#8 sheet_cell_create (sheet=sheet@entry=0x5555555a6230, col=98, row=58599) at sheet.c:4713
#9 0x00007ffff7bcda21 in sheet_cell_fetch (sheet=sheet@entry=0x5555555a6230, col=<optimized out>, row=<optimized out>) at sheet.c:2225
#10 0x00007ffff7af4718 in paste_cell (dat=0x7fffffffcb50, src=0x5555557dfc48, target_row=<optimized out>, target_col=<optimized out>) at clipboard.c:273
#11 cb_paste_cell (src=0x5555557dfc48, ignore=<optimized out>, dat=0x7fffffffcb50) at clipboard.c:379
#12 0x00007ffff6dc67a0 in g_hash_table_foreach () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#13 0x00007ffff7af5175 in clipboard_paste_region (cr=0x5555557d5a90, pt=pt@entry=0x55555626f100, cc=0x55555592e040) at clipboard.c:625
#14 0x00007ffff7aff15d in cmd_paste_copy_impl (cmd=0x55555626f0b0, wbc=0x55555592e040, is_undo=0) at commands.c:3002
#15 0x00007ffff7b03ce6 in gnm_command_push_undo (wbc=wbc@entry=0x55555592e040, obj=0x55555626f0b0) at commands.c:729
#16 0x00007ffff7b058a2 in cmd_paste_copy (wbc=wbc@entry=0x55555592e040, pt=pt@entry=0x7fffffffcd30, cr=<optimized out>) at commands.c:3239
#17 0x00007ffff7af6cc6 in cmd_paste (wbc=0x55555592e040, pt=0x7fffffffcd30) at cmd-edit.c:349
#18 0x00007ffff7af6e0d in cmd_paste_to_selection (wbc=0x55555592e040, dest_sv=0x5555558f40d0, paste_flags=163869) at cmd-edit.c:378
#19 0x00007ffff6ed2500 in g_closure_invoke () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#20 0x00007ffff6ee5b46 in () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#21 0x00007ffff6eec6c5 in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#22 0x00007ffff6eec88f in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#23 0x00007ffff70d5800 in () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#24 0x00007ffff70d5d89 in () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#25 0x00007ffff6ed2500 in g_closure_invoke () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#26 0x00007ffff6ee5b46 in () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#27 0x00007ffff6eebefd in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#28 0x00007ffff6eec88f in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#29 0x00007ffff712e338 in gtk_accel_group_activate () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#30 0x00007ffff712fbe5 in gtk_accel_groups_activate () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#31 0x00007ffff73dc8ee in gtk_window_activate_key () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#32 0x00007ffff73dcbb1 in () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#33 0x00007ffff740d144 in () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#34 0x00007ffff6ed26f9 in () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#35 0x00007ffff6eebb2e in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#36 0x00007ffff6eec88f in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#37 0x00007ffff73b7554 in () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#38 0x00007ffff726d6ff in () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#39 0x00007ffff726f066 in gtk_main_do_event () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#40 0x00007ffff6f575a5 in () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#41 0x00007ffff6f8b5b2 in () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#42 0x00007ffff6dd8739 in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#43 0x00007ffff6dd89c8 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#44 0x00007ffff6dd8c7f in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#45 0x00007ffff726e265 in gtk_main () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#46 0x0000555555557d50 in main (argc=<optimized out>, argv=<optimized out>) at main-application.c:343
(gdb)
single stepping, looks missing glib sources?
gnumeric-double:
Thread 1 "gnumeric" hit Breakpoint 1, gnumeric_log10 (ei=0x7fffffffcbf0, argv=<optimized out>) at functions.c:1532
1532 return value_new_float (gnm_log10 (t));
(gdb) s
__log10 (x=10000000) at ./math/w_log10_compat.c:30
30 ./math/w_log10_compat.c: No such file or directory.
(gdb) s
44 in ./math/w_log10_compat.c
(gdb) s
__ieee754_log10 (x=10000000) at ../sysdeps/ieee754/dbl-64/e_log10.c:64
64 ../sysdeps/ieee754/dbl-64/e_log10.c: No such file or directory.
(gdb) s
67 in ../sysdeps/ieee754/dbl-64/e_log10.c
... 4 times more ...
(gdb) s
87 in ../sysdeps/ieee754/dbl-64/e_log10.c
(gdb) s
__ieee754_log_fma (x=1.1920928955078125) at ../sysdeps/ieee754/dbl-64/e_log.c:56
56 ../sysdeps/ieee754/dbl-64/e_log.c: No such file or directory.
(gdb) s
asuint64 (f=1.1920928955078125) at ../sysdeps/ieee754/dbl-64/math_config.h:63
63 ../sysdeps/ieee754/dbl-64/math_config.h: No such file or directory.
(gdb) s
__ieee754_log_fma (x=1.1920928955078125) at ../sysdeps/ieee754/dbl-64/e_log.c:57
57 ../sysdeps/ieee754/dbl-64/e_log.c: No such file or directory.
(gdb) s
top16 (x=1.1920928955078125) at ../sysdeps/ieee754/dbl-64/math_config.h:68
68 ../sysdeps/ieee754/dbl-64/math_config.h: No such file or directory.
(gdb) s
57 ../sysdeps/ieee754/dbl-64/e_log.c: No such file or directory.
single stepping, looks missing glib sources?
gnumeric-long:
Thread 1 "gnumeric" hit Breakpoint 1, gnumeric_log10 (ei=0x7fffffffcc00, argv=<optimized out>) at functions.c:1532
1532 return value_new_float (gnm_log10 (t));
(gdb) s
__log10l (x=10000000) at ./math/w_log10l_compat.c:30
30 ./math/w_log10l_compat.c: No such file or directory.
(gdb) s
44 in ./math/w_log10l_compat.c
(gdb) s
__ieee754_log10l () at ../sysdeps/x86_64/fpu/e_log10l.S:31
31 ../sysdeps/x86_64/fpu/e_log10l.S: No such file or directory.
(gdb) s
32 in ../sysdeps/x86_64/fpu/e_log10l.S
... 13 times more ...
(gdb) s
56 in ../sysdeps/x86_64/fpu/e_log10l.S
(gdb) s
__ieee754_log10l () at ../sysdeps/x86_64/fpu/e_log10l.S:57
57 in ../sysdeps/x86_64/fpu/e_log10l.S
(gdb) s
value_new_float (f=7.00000000000000000043) at value.c:119
119 if (gnm_finite (f)) {
(gdb)