fix the test case; it really is an overflow on division, there's a

Derek Atkins warlord at MIT.EDU
Sat Jun 26 19:42:06 EDT 2004


linas at linas.org (Linas Vepstas) writes:

> On Sat, Jun 26, 2004 at 07:30:46PM -0400, Derek Atkins was heard to remark:
>> Linas Vepstas <linas at cvs.gnucash.org> writes:
>> 
>> > fix the test case; it really is an overflow on division, 
>> > there's a bunch of huge prime numbers involved.
>> 
>> Unfortunately this test-case actually came from test-query..  It had
>> created a random transaction that happened to have those two values as
>> the amount and value and was trying to compute the shareprice.
>
> I'm trying to fix the make-random-transaction so that it won't gen
> insane data. Harder done than said.

Thanks. 
I'm not at all surprised that it's being hard...

>> Could you please explain exactly what a division overflow means?
>
> if x=a/b and y =c/d  then x/y = (a*d)/(b*c)  If, after eliminating
> all common factors from the above, the if the numerator and/or
> denominator are *still* greater than 2^63 then its an overflow.
>
>> If this test-case really is going to over-flow on this operation then
>> we need to fix all the other tests to make "reasonable" random
>> gnc-numerics.  Go run 'test-query' and watch it fail consistently
>
> Yes. 

Ok, at least we can reproduce that, now.  :)

> --linas

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-devel mailing list