r15484 - gnucash/trunk - Add lib/libc/pow.h to avoid calculation errors on Windows.

Andreas Köhler andi5 at cvs.gnucash.org
Wed Jan 31 20:08:07 EST 2007


Author: andi5
Date: 2007-01-31 20:08:05 -0500 (Wed, 31 Jan 2007)
New Revision: 15484
Trac: http://svn.gnucash.org/trac/changeset/15484

Added:
   gnucash/trunk/lib/libc/pow.h
Modified:
   gnucash/trunk/lib/libc/Makefile.am
   gnucash/trunk/lib/libqof/qof/gnc-numeric.c
   gnucash/trunk/src/app-utils/Makefile.am
   gnucash/trunk/src/app-utils/gnc-ui-util.c
   gnucash/trunk/src/calculation/Makefile.am
   gnucash/trunk/src/calculation/fin.c
   gnucash/trunk/src/gnome-utils/dialog-account.c
Log:
Add lib/libc/pow.h to avoid calculation errors on Windows.

If the return value of pow is not saved in a double but rather used for
other calculations or casts, results can be bad, like pow(10, 2) being
99 instead of 100. Wrap pow and store the return value first before
continuing.




More information about the gnucash-patches mailing list