From: The Written Word Inc Date: 2011-11-15T05:50:05+09:00 Subject: [ruby-core:41042] [ruby-trunk - Bug #5497] Math.log10(10_000) error on HP-UX/PA Issue #5497 has been updated by The Written Word Inc. Yui NARUSE wrote: > The Written Word Inc wrote: > > $ cat t.c > > #include > > #include > > > > int main(void) { > > printf("%f\n", log10(10000)); > > printf("%a\n", log10(10000)); > > return 0; > > } > > > > %a is only supported on HP-UX/IA systems, not HP-UX/PA. We're using the HP-UX C compiler to build Ruby as well. > > OK, can you show a result without %a? > As B��lka says, this is because it is floating point, but it can be fixed by some options to specify libm as IEEE 754 mode. $ cat t.c #include #include int main(void) { printf("%f\n", log10(10000)); return 0; } $ cc t.c -lm $ ./a.out 4.000000 ---------------------------------------- Bug #5497: Math.log10(10_000) error on HP-UX/PA http://redmine.ruby-lang.org/issues/5497 Author: The Written Word Inc Status: Open Priority: Normal Assignee: Category: core Target version: 1.9.2 ruby -v: UNKNOWN I've built 1.9.2 from svn revision at 33531 on HP-UX/PA and HP-UX/IA. I'm getting two different results for Math.log10(10_000) depending on IA64 and PA-RISC: (ia64) p Math.log10(10_000) 4 (pa-risc) p Math.log10(10_000) 3.9999999999999996 Any idea where in the code I can look to try and fix this? -- http://redmine.ruby-lang.org