Am 28.07.2014 um 03:44 schrieb JonY: > On 7/27/2014 23:50, André Hentschel wrote: >> Am 26.07.2014 um 01:54 schrieb JonY: >>> On 7/26/2014 06:20, André Hentschel wrote: >>>> +double log2(double x) +{ + return softmath_log(x) / softmath_log(2); +} >> >>> Any reason not to expand softmath_log(2) into a constant? Otherwise, it >>> looks OK. >> >> >> >> Like this? >> > > > Yes, but I'm not sure if 0.69314718246459960938d and > 0.69314718246459960938f having the same precision matters, do you get > the same results when tested against the original code? > >
the compiler trims the number to fit in a float, and having the same number makes the code easier to read, further we could make up a macro or simple definition for it... ------------------------------------------------------------------------------ Infragistics Professional Build stunning WinForms apps today! Reboot your WinForms applications with our WinForms controls. Build a bridge from your legacy apps to the future. http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public