Commit Graph

16322 Commits

Author SHA1 Message Date
Christoph Holtermann
fe70e260fa Small corrections (py invoice template, doxygen) 2014-12-08 13:30:17 -08:00
VERDOÏA Laurent
7424e14525 French typo correction
ctte -> cette
2014-12-08 13:30:13 -08:00
John Ralls
f0f382cb06 Merge branch 'maint'
Ensure a merge commit after fast-forward merge from maint yesterday.
2014-12-08 12:43:16 -08:00
John Ralls
369befaae4 Don't use uint as an alias for unsigned int.
MinGW doesn't know about it, and errors out.
2014-12-08 09:49:56 -08:00
John Ralls
c5d87ec3b6 Work around bug in some versions of gtest which error out on EXPECT_EQ (false, foo).
A problem version is shipped by Debian Wheezy; Debian Jessie has a working version.
2014-12-07 21:59:36 -08:00
John Ralls
0c47414364 Make the gtest section fail properly when presented with the broken Fedora installation of gtest.
Fedora users will need to install sources and pass --gtest-root and --gmock-root to configure.
2014-12-07 21:59:36 -08:00
John Ralls
85c1b2293b Except latest Apple clang from long-form error messages. 2014-12-07 21:54:24 -08:00
John Ralls
f649da86f8 Fix up test makefiles to provide linkage paths for Guile2.
Which is apparently not as smart as Guile1 when loading for libs in the current directory.
2014-12-07 21:53:23 -08:00
John Ralls
689a25e56f More Guile compilation library links, needed in master but not maint. 2014-12-07 15:38:40 -08:00
Frank H. Ellenberger
67c0c41e92 Add ChangeLog.2013 to dist_doc_DATA
Happy New Year! ;-)
2014-12-07 15:07:39 -08:00
Frank H. Ellenberger
a41a6d6359 Update of de.po: 152 + 38 remaining 2014-12-07 15:07:39 -08:00
Geert Janssens
3061d31f06 Yet another guile 2 precompile fix of the German tax report
The previous one only fixed part of the problem
2014-12-07 15:07:39 -08:00
Geert Janssens
9a3a0a85d1 Fix guile 2 precompilation of German tax report 2014-12-07 15:07:39 -08:00
John Ralls
d764f7663c Guile compilation: One missed CLEANFILES. 2014-12-07 15:07:38 -08:00
John Ralls
8df252436a Fix the *.win32-bin.txt and downloaded.mt940 attributes. 2014-12-07 15:07:38 -08:00
John Ralls
42da6bd96e Guile precompilation: One more missing library-dir. 2014-12-07 15:07:38 -08:00
John Ralls
3ea118b6b4 Reapply fix of Guile precompilation without unwanted change in gnc-numeric.c. 2014-12-07 15:07:38 -08:00
John Ralls
8fa4741438 Revert "Fix Guile-2.0 precompilation."
This reverts commit a26801ab0e.
2014-12-07 15:07:38 -08:00
John Ralls
1179a79a01 Fix Guile-2.0 precompilation. 2014-12-07 15:06:44 -08:00
Frank H. Ellenberger
13f5b47872 Update of de.po: 351 +50 remaining 2014-12-07 15:01:25 -08:00
John Ralls
b49f64961c Bug 738477 - WebKit is broken on Win32.
Turns out our URL for loading jqplot is what was broken.
2014-12-07 15:01:24 -08:00
Frank H. Ellenberger
6d6f95bb9b Update of de.po -still 530 + 53 to review
Rework of
0022bc21f4
2014-12-07 15:01:24 -08:00
John Ralls
4654f49d5c Fix build on older versions of gcc
Gcc 4.7 thinks there's a conflict with C99 stdint macros and C++, even with -std=c++11.
2014-12-07 13:57:55 -08:00
John Ralls
495c939c3e C++-numeric: Fix up some 64-bit and GCC problems.
Still won't compile on gcc-4.7 (f18) because of poor C++11 compliance wrt UINT64_MAX, UINT64_C, and PRIu_64 macros.
2014-12-07 11:42:39 -08:00
John Ralls
ae7e9c2412 Merge branch 'c++-numeric'
A new C++ implementation of 128-bit math replaces qofmath128.c with
gnc-int128.cpp, and the gnc-numeric arithmetic operations now wrap
the equivalent functions in a new GncRational class, which works with
a GncDenom class to handle rounding and denominator-type settings.

All arithmetic is now done with 128 bits of precision and no overflows
are signalled until conversion back to the int64_t-based gnc_numeric.
C++ clients will be able to use GncRational directly, at which point
some of its other functionality can be added; this will allow chained
128-bit arithmetic, which will permit more complicated calculations
without overflow.

Operators are not implemented for GncRational (they are for GncInt128,
which makes the GncRational implemntation much easier to read) because
of the need for passing denominator and rounding specs.
2014-12-05 15:47:54 -08:00
John Ralls
8a3e368791 Rename QofInt128 to GncInt128.
It has nothing to do with QOF.
2014-12-05 15:46:07 -08:00
John Ralls
d35bcdb877 Move arithmetic functions into C++ implementation. 2014-12-05 14:50:23 -08:00
Frank H. Ellenberger
a6230fbb9d Add ChangeLog.2013 to dist_doc_DATA
Happy New Year! ;-)
2014-12-05 09:41:50 +01:00
Frank H. Ellenberger
2c49aec20a Update of de.po: 152 + 38 remaining 2014-12-05 08:20:57 +01:00
John Ralls
8e429f7458 Rename GncNumeric to GncRational and move to its own files. 2014-12-04 11:48:08 -08:00
John Ralls
79938cae2e Remove qofmath128, replaced by qofint128. 2014-12-03 16:47:45 -08:00
John Ralls
7c7946dec8 Disable rescaling big GncNumerics when there is a pre-calculated auto denom. 2014-12-03 16:28:55 -08:00
John Ralls
503a607090 More overflow-avoidance.
One source of overflow during testing was changing the denominator on a
max-precision number. If the numerator was clamped with a large denominator,
changing to a smaller denominator without rescaling created a number that
would overflow later when applied to a commodity with a different SCU. This
change re-scales numerators in those cases so that the overflows don't happen.
2014-12-03 16:28:55 -08:00
John Ralls
456e121930 Ensure random numeric denominator is the account SCU when creating splits.
The lot creation and balancing code uses gnc_numeric_foo_fixed(), assuming that
all amounts in a split have the same denominator, the account's SCU. Ensuring
this when creating test cases prevents spurious failures.
2014-12-03 16:28:54 -08:00
John Ralls
b694df7202 Prevent overflow.
LCD denom was equivalent to using rounding.denom, which is val.denom * 10.
If val.num was at the max # of digits that would overflow, so instead
fix val.denom and actually round the result; since we're adding
5/(val.denom * 10) to accomplish the rounding we want to truncate the result.
2014-12-03 16:28:54 -08:00
John Ralls
701d8030b8 Ensure numeric errors aren't stored in split amounts or values. 2014-12-03 16:28:54 -08:00
John Ralls
c4d649bc93 A better, clearer approach to constraining random gnc_numerics
Which happens to actually work.
2014-12-03 16:28:54 -08:00
John Ralls
33a0c4e968 Reimplement gnc_numeric with QofInt128
And in a more C++ idiom.
2014-12-03 16:28:54 -08:00
John Ralls
ab94094523 Lose the value returns for various reasons of inequality. 2014-12-03 16:28:54 -08:00
John Ralls
a99335104f Assert that the quotient and remainder references aren't this.
Otherwise this gets zeroed and produces a wrong result.
2014-12-03 16:28:54 -08:00
John Ralls
f4c69dbc48 Ensure that the sign is correctly preserved and transferred. 2014-12-03 16:28:54 -08:00
John Ralls
9e37ad27b3 Implement QofInt128.pow. 2014-12-03 16:28:54 -08:00
John Ralls
f5c7b1101d Implement QofInt128::gcd and lcm. 2014-12-03 16:28:54 -08:00
John Ralls
765d5583c1 Fix mask error in operator<<= and operator>>=
Must specify 1 as a uint64_t to get the right masks.
2014-12-03 16:28:54 -08:00
John Ralls
7c22669a76 Check for incoming overflow and NaN on all class computational operators. 2014-12-03 16:28:54 -08:00
John Ralls
296ce314a3 Extract a class function bits() to return a size value.
Helps to pre-determine overflow. Also correct the original implementation
in operator *=, which got the wrong answer.
2014-12-03 16:28:53 -08:00
John Ralls
1b288df20d Add bitwise operators and binary operators. 2014-12-03 16:28:53 -08:00
John Ralls
c649aa9736 Some more constructors, for convenience. 2014-12-03 16:28:53 -08:00
John Ralls
810a6bc8ae Operators /= and %= plus function div() for QofInt128. 2014-12-03 16:28:53 -08:00
John Ralls
1c83db5896 Add increment, decrement, and shift-eauals operators to QofInt128.
They'll be needed for division.
2014-12-03 16:28:53 -08:00